opt: 优化设备报警记录页面,并且实现国际化
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.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||||
import org.nl.acs.history.service.mapper.AcsDeviceErrorLogMapper;
|
import org.nl.acs.history.service.mapper.AcsDeviceErrorLogMapper;
|
||||||
|
import org.nl.acs.task.domain.Task;
|
||||||
import org.nl.acs.utils.PageUtil;
|
import org.nl.acs.utils.PageUtil;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.FileUtil;
|
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 device_code = MapUtil.getStr(whereJson, "device_code");
|
||||||
String error_code = MapUtil.getStr(whereJson, "error_code");
|
String error_code = MapUtil.getStr(whereJson, "error_code");
|
||||||
String error_info = MapUtil.getStr(whereJson, "error_info");
|
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<>();
|
LambdaQueryWrapper<AcsDeviceErrorLog> wrapper = new LambdaQueryWrapper<>();
|
||||||
if (StrUtil.isNotEmpty(device_code)) {
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
wrapper.like(AcsDeviceErrorLog::getDevice_code, device_code);
|
wrapper.like(AcsDeviceErrorLog::getDevice_code, device_code);
|
||||||
@@ -78,6 +81,9 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl<AcsDeviceErrorL
|
|||||||
if (StrUtil.isNotEmpty(error_info)) {
|
if (StrUtil.isNotEmpty(error_info)) {
|
||||||
wrapper.like(AcsDeviceErrorLog::getError_info, 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;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import customPolicy from './customPolicy/zh'
|
|||||||
import monitor from './monitor/zh'
|
import monitor from './monitor/zh'
|
||||||
import timing from './timing/zh'
|
import timing from './timing/zh'
|
||||||
import config from './config/zh'
|
import config from './config/zh'
|
||||||
|
import deviceErrorInfo from './deviceErrorInfo/zh'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...zhLocale,
|
...zhLocale,
|
||||||
@@ -35,6 +36,7 @@ export default {
|
|||||||
...customPolicy,
|
...customPolicy,
|
||||||
...monitor,
|
...monitor,
|
||||||
...timing,
|
...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 timing from './timing/en'
|
||||||
import config from './config/en'
|
import config from './config/en'
|
||||||
import customPolicy from './customPolicy/en'
|
import customPolicy from './customPolicy/en'
|
||||||
|
import deviceErrorInfo from './deviceErrorInfo/en'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...enLocale,
|
...enLocale,
|
||||||
@@ -35,6 +36,7 @@ export default {
|
|||||||
...customPolicy,
|
...customPolicy,
|
||||||
...monitor,
|
...monitor,
|
||||||
...timing,
|
...timing,
|
||||||
...config
|
...config,
|
||||||
|
...deviceErrorInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import monitor from './monitor/in'
|
|||||||
import timing from './timing/in'
|
import timing from './timing/in'
|
||||||
import config from './config/in'
|
import config from './config/in'
|
||||||
import customPolicy from './customPolicy/in'
|
import customPolicy from './customPolicy/in'
|
||||||
|
import deviceErrorInfo from './deviceErrorInfo/in'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...idLocale,
|
...idLocale,
|
||||||
@@ -36,5 +37,6 @@ export default {
|
|||||||
...auto,
|
...auto,
|
||||||
...monitor,
|
...monitor,
|
||||||
...config,
|
...config,
|
||||||
...timing
|
...timing,
|
||||||
|
...deviceErrorInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<div v-if="crud.props.searchToggle">
|
<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
|
<el-input
|
||||||
v-model="query.device_code"
|
v-model="query.device_code"
|
||||||
clearable
|
clearable
|
||||||
placeholder="设备编码"
|
:placeholder="$t('errorLog.table.device_code')"
|
||||||
style="width: 185px;"
|
style="width: 185px;"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="query.error_code"
|
v-model="query.error_code"
|
||||||
clearable
|
clearable
|
||||||
placeholder="报警编码"
|
:placeholder="$t('errorLog.table.alarm_code')"
|
||||||
style="width: 185px;"
|
style="width: 185px;"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
@@ -24,81 +24,20 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="query.error_info"
|
v-model="query.error_info"
|
||||||
clearable
|
clearable
|
||||||
placeholder="报警信息"
|
:placeholder="$t('errorLog.table.alarm_message')"
|
||||||
style="width: 185px;"
|
style="width: 185px;"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@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
|
<el-date-picker
|
||||||
v-model="query.timeRange"
|
v-model="value"
|
||||||
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"
|
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
clearable
|
:end-placeholder="$t('errorLog.table.end_time')"
|
||||||
picker-options="{
|
:start-placeholder="$t('errorLog.table.start_time')"
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
shortcuts: [{
|
:picker-options="pickerOptions"
|
||||||
text: '最近一小时',
|
@change="pickerChange"
|
||||||
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;
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}"
|
|
||||||
/> -->
|
|
||||||
<rrOperation :crud="crud" />
|
<rrOperation :crud="crud" />
|
||||||
</div>
|
</div>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
@@ -139,13 +78,13 @@
|
|||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="device_code" label="设备编码" />
|
<el-table-column prop="device_code" :label="$t('errorLog.table.device_code')" />
|
||||||
<el-table-column prop="error_code" label="报警编码" />
|
<el-table-column prop="error_code" :label="$t('errorLog.table.alarm_code')" />
|
||||||
<el-table-column prop="error_info" label="报警信息" />
|
<el-table-column prop="error_info" :label="$t('errorLog.table.alarm_message')" />
|
||||||
<el-table-column prop="error_time" label="报警时间" />
|
<el-table-column prop="error_time" :label="$t('errorLog.table.error_time')" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-permission="['admin','acsDeviceErrorLog:edit','acsDeviceErrorLog:del']"
|
v-permission="['admin','acsDeviceErrorLog:edit','acsDeviceErrorLog:del']"
|
||||||
label="操作"
|
:label="$t('Auto.table.operate')"
|
||||||
width="150px"
|
width="150px"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
@@ -207,21 +146,52 @@ export default {
|
|||||||
{ key: 'device_code', display_name: '设备编码' },
|
{ key: 'device_code', display_name: '设备编码' },
|
||||||
{ key: 'error_code', display_name: '报警编码' },
|
{ key: 'error_code', display_name: '报警编码' },
|
||||||
{ key: 'error_info', 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: {
|
methods: {
|
||||||
|
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
console.log(this.query.value)
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
handleDateChange() {
|
pickerChange() {
|
||||||
/* if (this.timeRange && this.timeRange.length === 2) {
|
if (this.value && this.value.length === 2) {
|
||||||
this.crud.url = 'api/deviceErrorLog?page=0&size=10&sort=error_log_uuid,desc' +
|
this.query.start_time = this.value[0]
|
||||||
'&start_time=' + this.timeRange[0] + '&end_time=' + this.timeRange[1]
|
this.query.end_time = this.value[1]
|
||||||
} else {
|
} else {
|
||||||
this.crud.url = 'api/deviceErrorLog?page=0&size=10&sort=error_log_uuid,desc'
|
this.query.start_time = ''
|
||||||
} */
|
this.query.end_time = ''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
doExportDeviceErrorLogging() {
|
doExportDeviceErrorLogging() {
|
||||||
this.downLoadTaskLogging = true
|
this.downLoadTaskLogging = true
|
||||||
@@ -229,8 +199,8 @@ export default {
|
|||||||
device_code: this.query.device_code,
|
device_code: this.query.device_code,
|
||||||
error_code: this.query.error_code,
|
error_code: this.query.error_code,
|
||||||
error_info: this.query.error_info,
|
error_info: this.query.error_info,
|
||||||
start_time: this.crud.createTime,
|
start_time: this.query.start_time,
|
||||||
end_time: this.crud.endTime
|
end_time: this.query.end_time
|
||||||
}
|
}
|
||||||
const url = '/api/deviceErrorLog/download'
|
const url = '/api/deviceErrorLog/download'
|
||||||
download(url, params).then(result => {
|
download(url, params).then(result => {
|
||||||
|
|||||||
Reference in New Issue
Block a user