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 => {