Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -22,6 +22,7 @@ import org.nl.acs.history.domain.AcsDeviceErrorLog;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.mapper.AcsDeviceErrorLogMapper;
|
||||
import org.nl.acs.task.domain.Task;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.FileUtil;
|
||||
@@ -68,6 +69,8 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String error_code = MapUtil.getStr(whereJson, "error_code");
|
||||
String error_info = MapUtil.getStr(whereJson, "error_info");
|
||||
String start_time = MapUtil.getStr(whereJson, "start_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
LambdaQueryWrapper<AcsDeviceErrorLog> wrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
wrapper.like(AcsDeviceErrorLog::getDevice_code, device_code);
|
||||
@@ -78,6 +81,9 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
||||
if (StrUtil.isNotEmpty(error_info)) {
|
||||
wrapper.like(AcsDeviceErrorLog::getError_info, error_info);
|
||||
}
|
||||
if (!StrUtil.isEmpty(start_time) && !StrUtil.isEmpty(end_time)) {
|
||||
wrapper.between(AcsDeviceErrorLog::getError_time, start_time, end_time);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import customPolicy from './customPolicy/zh'
|
||||
import monitor from './monitor/zh'
|
||||
import timing from './timing/zh'
|
||||
import config from './config/zh'
|
||||
import deviceErrorInfo from './deviceErrorInfo/zh'
|
||||
|
||||
export default {
|
||||
...zhLocale,
|
||||
@@ -35,6 +36,7 @@ export default {
|
||||
...customPolicy,
|
||||
...monitor,
|
||||
...timing,
|
||||
...config
|
||||
...config,
|
||||
...deviceErrorInfo
|
||||
}
|
||||
|
||||
|
||||
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/en.js
Normal file
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/en.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'errorLog': {
|
||||
'table': {
|
||||
'device_code': 'Device Code',
|
||||
'alarm_code': 'Alarm Code',
|
||||
'alarm_message': 'Alarm Message',
|
||||
'start_time': 'Start Time',
|
||||
'end_time': 'End Time',
|
||||
'error_time': 'Error Time'
|
||||
}
|
||||
}
|
||||
}
|
||||
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/in.js
Normal file
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/in.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'errorLog': {
|
||||
'table': {
|
||||
'device_code': 'Kode Perangkat',
|
||||
'alarm_code': 'Kode Alarm',
|
||||
'alarm_message': 'Pesan Peringatan',
|
||||
'start_time': 'Tanggal Mulai',
|
||||
'end_time': 'Tanggal Selesai',
|
||||
'error_time': 'Waktu Kesalahan'
|
||||
}
|
||||
}
|
||||
}
|
||||
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/zh.js
Normal file
12
acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/zh.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'errorLog': {
|
||||
'table': {
|
||||
'device_code': '设备编码',
|
||||
'alarm_code': '报警编码',
|
||||
'alarm_message': '报警信息',
|
||||
'start_time': '开始日期',
|
||||
'end_time': '结束日期',
|
||||
'error_time': '错误时间'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import monitor from './monitor/en'
|
||||
import timing from './timing/en'
|
||||
import config from './config/en'
|
||||
import customPolicy from './customPolicy/en'
|
||||
import deviceErrorInfo from './deviceErrorInfo/en'
|
||||
|
||||
export default {
|
||||
...enLocale,
|
||||
@@ -35,6 +36,7 @@ export default {
|
||||
...customPolicy,
|
||||
...monitor,
|
||||
...timing,
|
||||
...config
|
||||
...config,
|
||||
...deviceErrorInfo
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import monitor from './monitor/in'
|
||||
import timing from './timing/in'
|
||||
import config from './config/in'
|
||||
import customPolicy from './customPolicy/in'
|
||||
import deviceErrorInfo from './deviceErrorInfo/in'
|
||||
|
||||
export default {
|
||||
...idLocale,
|
||||
@@ -36,5 +37,6 @@ export default {
|
||||
...auto,
|
||||
...monitor,
|
||||
...config,
|
||||
...timing
|
||||
...timing,
|
||||
...deviceErrorInfo
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">设备编码</label>
|
||||
<label class="el-form-item-label">{{ $t('errorLog.table.device_code') }}</label>
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
placeholder="设备编码"
|
||||
:placeholder="$t('errorLog.table.device_code')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -16,7 +16,7 @@
|
||||
<el-input
|
||||
v-model="query.error_code"
|
||||
clearable
|
||||
placeholder="报警编码"
|
||||
:placeholder="$t('errorLog.table.alarm_code')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -24,81 +24,20 @@
|
||||
<el-input
|
||||
v-model="query.error_info"
|
||||
clearable
|
||||
placeholder="报警信息"
|
||||
:placeholder="$t('errorLog.table.alarm_message')"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<!-- <el-date-picker
|
||||
v-model="query.error_time"
|
||||
clearable
|
||||
placeholder="错误时间"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
:range-separator="'至'"
|
||||
:start-placeholder="'开始时间'"
|
||||
:end-placeholder="'结束时间'"
|
||||
class="date-item"
|
||||
@change="handleDateChange"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/> -->
|
||||
<!-- <el-date-picker
|
||||
v-model="query.start_time"
|
||||
clearable
|
||||
placeholder="错误时间"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
class="date-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/> -->
|
||||
<el-date-picker
|
||||
v-model="query.timeRange"
|
||||
type="daterange"
|
||||
clearable
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
class="date-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<!-- <el-date-picker
|
||||
v-model="timeRange"
|
||||
v-model="value"
|
||||
type="datetimerange"
|
||||
clearable
|
||||
picker-options="{
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
shortcuts: [{
|
||||
text: '最近一小时',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date(end.getTime() - 3600000);
|
||||
picker.$emit('pick', [start, end]);
|
||||
// 将时间范围值赋值给start_time和end_time
|
||||
this.start_time = start;
|
||||
this.end_time = end;
|
||||
}
|
||||
}, {
|
||||
text: '最近一天',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date(end.getTime() - 24 * 3600000);
|
||||
picker.$emit('pick', [start, end]);
|
||||
// 将时间范围值赋值给start_time和end_time
|
||||
this.start_time = start;
|
||||
this.end_time = end;
|
||||
}
|
||||
}, {
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date(end.getTime() - 7 * 24 * 3600000);
|
||||
picker.$emit('pick', [start, end]);
|
||||
// 将时间范围值赋值给start_time和end_time
|
||||
this.start_time = start;
|
||||
this.end_time = end;
|
||||
}
|
||||
}]
|
||||
}"
|
||||
/> -->
|
||||
:end-placeholder="$t('errorLog.table.end_time')"
|
||||
:start-placeholder="$t('errorLog.table.start_time')"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
:picker-options="pickerOptions"
|
||||
@change="pickerChange"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
@@ -139,13 +78,13 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="error_code" label="报警编码" />
|
||||
<el-table-column prop="error_info" label="报警信息" />
|
||||
<el-table-column prop="error_time" label="报警时间" />
|
||||
<el-table-column prop="device_code" :label="$t('errorLog.table.device_code')" />
|
||||
<el-table-column prop="error_code" :label="$t('errorLog.table.alarm_code')" />
|
||||
<el-table-column prop="error_info" :label="$t('errorLog.table.alarm_message')" />
|
||||
<el-table-column prop="error_time" :label="$t('errorLog.table.error_time')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','acsDeviceErrorLog:edit','acsDeviceErrorLog:del']"
|
||||
label="操作"
|
||||
:label="$t('Auto.table.operate')"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
@@ -207,21 +146,52 @@ export default {
|
||||
{ key: 'device_code', display_name: '设备编码' },
|
||||
{ key: 'error_code', display_name: '报警编码' },
|
||||
{ key: 'error_info', display_name: '报警信息' }
|
||||
]
|
||||
],
|
||||
value: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: this.$t('monitor.lucence.the_past_week'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: this.$t('monitor.lucence.the_past_month'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: this.$t('monitor.lucence.the_past_three_months'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
console.log(this.query.value)
|
||||
return true
|
||||
},
|
||||
handleDateChange() {
|
||||
/* if (this.timeRange && this.timeRange.length === 2) {
|
||||
this.crud.url = 'api/deviceErrorLog?page=0&size=10&sort=error_log_uuid,desc' +
|
||||
'&start_time=' + this.timeRange[0] + '&end_time=' + this.timeRange[1]
|
||||
pickerChange() {
|
||||
if (this.value && this.value.length === 2) {
|
||||
this.query.start_time = this.value[0]
|
||||
this.query.end_time = this.value[1]
|
||||
} else {
|
||||
this.crud.url = 'api/deviceErrorLog?page=0&size=10&sort=error_log_uuid,desc'
|
||||
} */
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
},
|
||||
doExportDeviceErrorLogging() {
|
||||
this.downLoadTaskLogging = true
|
||||
@@ -229,8 +199,8 @@ export default {
|
||||
device_code: this.query.device_code,
|
||||
error_code: this.query.error_code,
|
||||
error_info: this.query.error_info,
|
||||
start_time: this.crud.createTime,
|
||||
end_time: this.crud.endTime
|
||||
start_time: this.query.start_time,
|
||||
end_time: this.query.end_time
|
||||
}
|
||||
const url = '/api/deviceErrorLog/download'
|
||||
download(url, params).then(result => {
|
||||
|
||||
Reference in New Issue
Block a user