Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
bfb62dad40
@ -49,7 +49,7 @@ public class HeartbeatCommand implements BaseCommand{
|
||||
JsonNode realNode = linkNode.get("real");
|
||||
if (realNode != null){
|
||||
boolean real = realNode.asBoolean();
|
||||
String key = String.format("link:%s:modbus", linkId);
|
||||
String key = String.format("link:%s:real", linkId);
|
||||
ops.set(key, real, HEARTBEAT_TTL, TimeUnit.SECONDS);
|
||||
}
|
||||
JsonNode ftpNode = linkNode.get("ftp");
|
||||
|
@ -1258,6 +1258,7 @@ const getThisDayChartDataForMinute = () => {
|
||||
const len = val.iWindDirection.length
|
||||
const result: number[] = new Array(16).fill(0)
|
||||
val.iWindDirection.forEach((item: number) => {
|
||||
if (typeof item === 'number') {
|
||||
item = item < 0 ? 360 + item : item > 360 ? 360 : item
|
||||
if (item === 0) {
|
||||
result[0] += 1
|
||||
@ -1265,6 +1266,7 @@ const getThisDayChartDataForMinute = () => {
|
||||
const divisor = Math.ceil(item / 22.5) - 1
|
||||
result[divisor] += 1
|
||||
}
|
||||
}
|
||||
})
|
||||
const percent = result.map((item) => Math.floor((item / len) * 100000) / 1000)
|
||||
frequencyData.value = percent
|
||||
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<el-table :data="tableData" class="logTable">
|
||||
<el-table-column label="名称" prop="loggerName" align="left"></el-table-column>
|
||||
<el-table-column label="名称" prop="loggerName"></el-table-column>
|
||||
<el-table-column label="日志级别" prop="level" align="center">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.level" v-if="scope.row.hasEdit">
|
||||
@ -25,9 +25,10 @@
|
||||
<el-table-column label="操作" width="240px" align="center">
|
||||
<template #default="scope">
|
||||
<div class="logTableOperate">
|
||||
<div class="operate">
|
||||
<el-button v-if="scope.row.hasEdit" @click="submitLevel(scope.row)" text type="success">保存</el-button>
|
||||
<el-button v-if="scope.row.hasEdit" @click="cancelLevel(scope.row)" text type="info">取消</el-button>
|
||||
<el-button text type="primary" @click.stop="editLogConfiguration(scope)">编辑</el-button>
|
||||
</div>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delLogConfiguration(scope)">
|
||||
<template #reference>
|
||||
<el-button text type="danger" @click.stop>删除</el-button>
|
||||
@ -41,10 +42,10 @@
|
||||
<el-dialog :title="logDialogTitle" v-model="logDialogVisible" :width="400" align-center>
|
||||
<el-form :model="logFormModel" label-width="80">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="logFormModel.loggerName"></el-input>
|
||||
<el-input v-model="logFormModel.loggerName" placeholder="请输入日志名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="日志级别">
|
||||
<el-select v-model="logFormModel.level">
|
||||
<el-select v-model="logFormModel.level" placeholder="请选择日志级别">
|
||||
<el-option value="FATAL"></el-option>
|
||||
<el-option value="ERROR"></el-option>
|
||||
<el-option value="WARN"></el-option>
|
||||
@ -105,16 +106,17 @@ const submitlogForm = (data: { loggerName: string; level: string } | null) => {
|
||||
const closeLogForm = () => {
|
||||
logDialogVisible.value = false
|
||||
}
|
||||
const originLevel = ref('')
|
||||
const beforeRowData = ref<{ loggerName: string; level: string; hasEdit: boolean }>()
|
||||
const editLevel = (data: { loggerName: string; level: string; hasEdit: boolean }) => {
|
||||
originLevel.value = data.level
|
||||
beforeRowData.value && (beforeRowData.value.hasEdit = false)
|
||||
beforeRowData.value = data
|
||||
data.hasEdit = true
|
||||
}
|
||||
const submitLevel = (data: { loggerName: string; level: string; hasEdit: boolean }) => {
|
||||
submitlogForm({ loggerName: data.loggerName, level: data.level })
|
||||
}
|
||||
const cancelLevel = (data: { loggerName: string; level: string; hasEdit: boolean }) => {
|
||||
data.level = originLevel.value
|
||||
data.level = beforeRowData.value!.level
|
||||
data.hasEdit = false
|
||||
}
|
||||
const addLogConfiguration = () => {
|
||||
@ -151,8 +153,9 @@ const getLogList = () => {
|
||||
hasEdit: false,
|
||||
}
|
||||
})
|
||||
tableData.value = data
|
||||
// tableData.value = data
|
||||
originTableData = data
|
||||
change()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -186,14 +189,14 @@ getLogList()
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.el-select {
|
||||
width: 200px;
|
||||
width: 100px;
|
||||
}
|
||||
&:deep(.el-select__wrapper) {
|
||||
width: 200x;
|
||||
width: 100x;
|
||||
}
|
||||
.logTableOperate {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
.el-button {
|
||||
margin-left: 0;
|
||||
|
Loading…
Reference in New Issue
Block a user