From e1bf2f026c8134c7c4c3ebad460a8a9062033160 Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 8 Dec 2023 09:04:57 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E8=AE=B0=E5=BD=95=E9=A1=B5=E9=9D=A2,?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E5=AE=9E=E7=8E=B0=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DeviceErrorLogServiceImpl.java | 6 + acs/nladmin-ui/src/i18n/langs/chinese.js | 4 +- .../src/i18n/langs/deviceErrorInfo/en.js | 12 ++ .../src/i18n/langs/deviceErrorInfo/in.js | 12 ++ .../src/i18n/langs/deviceErrorInfo/zh.js | 12 ++ acs/nladmin-ui/src/i18n/langs/english.js | 4 +- acs/nladmin-ui/src/i18n/langs/indonesian.js | 4 +- .../acs/history/deviceErrorInfo/index.vue | 142 +++++++----------- 8 files changed, 107 insertions(+), 89 deletions(-) create mode 100644 acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/en.js create mode 100644 acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/in.js create mode 100644 acs/nladmin-ui/src/i18n/langs/deviceErrorInfo/zh.js diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java index c5e92df..dec168c 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java @@ -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 wrapper = new LambdaQueryWrapper<>(); if (StrUtil.isNotEmpty(device_code)) { wrapper.like(AcsDeviceErrorLog::getDevice_code, device_code); @@ -78,6 +81,9 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl
- + - - - + :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" + />
@@ -139,13 +78,13 @@ @selection-change="crud.selectionChangeHandler" > - - - - + + + + @@ -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 => {