forked from github/dataease
perf: 日志列表过滤及导出
This commit is contained in:
parent
ae9de856ce
commit
3169c79971
@ -21,7 +21,7 @@ const emits = defineEmits(['filter-change'])
|
|||||||
const selectStatus = ids => {
|
const selectStatus = ids => {
|
||||||
emits(
|
emits(
|
||||||
'filter-change',
|
'filter-change',
|
||||||
ids.map(item => item.label)
|
ids.map(item => item.id || item.value)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,12 @@ const valueTextFormTree = (val, options) => {
|
|||||||
}
|
}
|
||||||
return result || val
|
return result || val
|
||||||
}
|
}
|
||||||
|
const timestampFormatDate = value => {
|
||||||
|
if (!value) {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
return new Date(value)['format']()
|
||||||
|
}
|
||||||
const valueText = (field, val, options) => {
|
const valueText = (field, val, options) => {
|
||||||
for (let index = 0; index < options.length; index++) {
|
for (let index = 0; index < options.length; index++) {
|
||||||
const element = options[index]
|
const element = options[index]
|
||||||
@ -41,6 +47,9 @@ const valueText = (field, val, options) => {
|
|||||||
return item.name || item.label
|
return item.name || item.label
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (element.type === 'time') {
|
||||||
|
return timestampFormatDate(val)
|
||||||
|
}
|
||||||
if (isTree) {
|
if (isTree) {
|
||||||
return valueTextFormTree(val, selectOption)
|
return valueTextFormTree(val, selectOption)
|
||||||
}
|
}
|
||||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
|||||||
Subproject commit a30164b304688249585d2d9af53502a3a67211d2
|
Subproject commit 217f54b5a74178cb1de0b9daed983ea78bf48578
|
@ -11,11 +11,13 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class LogGridRequest extends KeywordRequest implements Serializable {
|
public class LogGridRequest extends KeywordRequest implements Serializable {
|
||||||
|
|
||||||
private String op;
|
private List<String> op;
|
||||||
|
|
||||||
private Long uid;
|
private List<Long> uid;
|
||||||
|
|
||||||
private Long oid;
|
private List<Long> oid;
|
||||||
|
|
||||||
private List<Long> time;
|
private List<Long> time;
|
||||||
|
|
||||||
|
private Boolean timeDesc = true;
|
||||||
}
|
}
|
||||||
|
@ -156,4 +156,8 @@ public interface UserApi {
|
|||||||
@Hidden
|
@Hidden
|
||||||
@GetMapping("/queryByAccount")
|
@GetMapping("/queryByAccount")
|
||||||
CurUserVO queryByAccount(String account);
|
CurUserVO queryByAccount(String account);
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@PostMapping("/all")
|
||||||
|
List<UserItem> allUser(@RequestBody KeywordRequest request);
|
||||||
}
|
}
|
||||||
|
22
sdk/common/src/main/java/io/dataease/utils/DateUtils.java
Normal file
22
sdk/common/src/main/java/io/dataease/utils/DateUtils.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package io.dataease.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
public class DateUtils {
|
||||||
|
|
||||||
|
public static String time2String(Long time, String pattern) {
|
||||||
|
if (StringUtils.isBlank(pattern)) pattern = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
DateTimeFormatter format = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
LocalDateTime timeByMilli = Instant.ofEpochMilli(time).atZone(ZoneId.of("Asia/Shanghai")).toLocalDateTime();
|
||||||
|
return format.format(timeByMilli);
|
||||||
|
}
|
||||||
|
public static String time2String(Long time) {
|
||||||
|
String pattern = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
return time2String(time, pattern);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user