Merge branch 'dev' into pr@dev@feat_liquid_dynamic_max
This commit is contained in:
commit
00da4e8965
@ -182,7 +182,7 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
if (beansOfType.keySet().size() == 0) return false;
|
||||
OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
|
||||
if (ObjectUtils.isEmpty(oidcXpackService)) return false;
|
||||
return oidcXpackService.isSuuportOIDC();
|
||||
return oidcXpackService.isSupportOIDC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -191,7 +191,7 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
if (beansOfType.keySet().size() == 0) return false;
|
||||
CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class);
|
||||
if (ObjectUtils.isEmpty(casXpackService)) return false;
|
||||
return casXpackService.suuportCas();
|
||||
return casXpackService.supportCas();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -57,7 +57,7 @@ public class SSOServer {
|
||||
DEException.throwException("缺少oidc插件");
|
||||
}
|
||||
oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
|
||||
Boolean suuportOIDC = oidcXpackService.isSuuportOIDC();
|
||||
Boolean suuportOIDC = oidcXpackService.isSupportOIDC();
|
||||
if (!suuportOIDC) {
|
||||
DEException.throwException("未开启oidc");
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public class EsProvider extends Provider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
|
||||
public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
|
||||
datasourceRequest.setQuery("desc " + String.format(EsSqlLConstants.KEYWORD_TABLE, datasourceRequest.getTable()));
|
||||
List<TableField> tableFields = new ArrayList<>();
|
||||
try {
|
||||
|
||||
@ -73,7 +73,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
|
||||
|
||||
@Override
|
||||
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
|
||||
public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase("mongo")) {
|
||||
datasourceRequest.setQuery("select * from " + datasourceRequest.getTable());
|
||||
return fetchResultField(datasourceRequest);
|
||||
|
||||
@ -1193,7 +1193,7 @@ public class ChartViewService {
|
||||
PluginViewParam pluginViewParam = new PluginViewParam();
|
||||
PluginViewSetImpl pluginViewSet = BeanUtils.copyBean(new PluginViewSetImpl(), table);
|
||||
pluginViewSet.setDsType(ds.getType());
|
||||
pluginViewSet.setTabelId(table.getId());
|
||||
pluginViewSet.setTableId(table.getId());
|
||||
pluginViewSet.setDs(ds);
|
||||
PluginViewLimit pluginViewLimit = BeanUtils.copyBean(new PluginViewLimit(), view);
|
||||
|
||||
|
||||
@ -23,10 +23,10 @@ public abstract class FilterBuildTemplate {
|
||||
|
||||
List<Map<String, Object>> filters = componentsFilter(components, "custom", null, null);
|
||||
|
||||
if(ObjectUtils.isNotEmpty(searchButton)) {
|
||||
if (ObjectUtils.isNotEmpty(searchButton)) {
|
||||
Map<String, Object> options = (Map<String, Object>) searchButton.get("options");
|
||||
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
|
||||
Boolean customRange = (Boolean)attrs.get("customRange");
|
||||
Boolean customRange = (Boolean) attrs.get("customRange");
|
||||
Boolean autoTrigger = (Boolean) attrs.get("autoTrigger");
|
||||
List<String> filterIds = (List<String>) attrs.get("filterIds");
|
||||
if (!autoTrigger) { // 不是自动触发 // 需要过滤掉按钮关联的条件组件
|
||||
@ -77,7 +77,7 @@ public abstract class FilterBuildTemplate {
|
||||
return ObjectUtils.isNotEmpty(condition) && CollectionUtils.isNotEmpty(condition.getValue()) && StringUtils.isNotBlank(condition.getValue().get(0));
|
||||
}
|
||||
|
||||
private static Boolean viewIdMatch(List<String> viewIds, String viewId) {
|
||||
private static Boolean viewIdMatch(List<String> viewIds, String viewId) {
|
||||
return CollectionUtils.isEmpty(viewIds) || viewIds.contains(viewId);
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public abstract class FilterBuildTemplate {
|
||||
Map<String, Object> component = filterParamTO.getComponent();
|
||||
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
|
||||
String fieldId = attrs.get("fieldId").toString();
|
||||
List<String> viewIds = (List<String>)attrs.get("viewIds");
|
||||
List<String> viewIds = (List<String>) attrs.get("viewIds");
|
||||
List<String> parameters = (List<String>) attrs.get("parameters");
|
||||
Boolean multiple = ObjectUtils.isNotEmpty(attrs.get("multiple")) && (Boolean) attrs.get("multiple");
|
||||
if (isTree && !multiple && CollectionUtils.isNotEmpty(value)) {
|
||||
@ -147,9 +147,9 @@ public abstract class FilterBuildTemplate {
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> componentsFilter(List<Map<String, Object>> components, String type,
|
||||
String componentType, String serviceName) {
|
||||
String componentType, String serviceName) {
|
||||
return components.stream().filter(component -> {
|
||||
String ctype = Optional.ofNullable(component.get("type")).orElse("").toString();
|
||||
String ctype = Optional.ofNullable(component.get("type")).orElse("").toString();
|
||||
String cComponentType = Optional.ofNullable(component.get("component")).orElse("").toString();
|
||||
String cServiceName = Optional.ofNullable(component.get("serviceName")).orElse("").toString();
|
||||
|
||||
@ -180,10 +180,20 @@ public abstract class FilterBuildTemplate {
|
||||
beanMapping.put("numberRangeWidget", "numberRangeWidget");
|
||||
beanMapping.put("textSelectTreeWidget", "textSelectTreeWidget");
|
||||
beanMapping.put("textInputWidget", "textInputWidget");
|
||||
beanMapping.put("timeDateWidget", "timeDateWidget");
|
||||
beanMapping.put("timeMonthWidget", "timeMonthWidget");
|
||||
beanMapping.put("timeYearWidget", "timeYearWidget");
|
||||
beanMapping.put("timeDateRangeWidget", "timeDateRangeWidget");
|
||||
String beanName = beanMapping.get(serviceName);
|
||||
if (StringUtils.isBlank(beanName) && StringUtils.containsIgnoreCase(serviceName, "select")) {
|
||||
beanName = "selectWidget";
|
||||
}
|
||||
return (FilterBuildTemplate)CommonBeanFactory.getBean(beanName);
|
||||
|
||||
return (FilterBuildTemplate) CommonBeanFactory.getBean(beanName);
|
||||
}
|
||||
|
||||
protected Map<String, Object> buildAttrs(Map<String, Object> component) {
|
||||
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
|
||||
return attrs;
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
String tableName = null;
|
||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class);
|
||||
if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) {
|
||||
tableName = TableUtils.tableName(pluginViewSet.getTabelId());
|
||||
tableName = TableUtils.tableName(pluginViewSet.getTableId());
|
||||
}else {
|
||||
switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) {
|
||||
case DB:
|
||||
|
||||
@ -0,0 +1,209 @@
|
||||
package io.dataease.service.chart.build;
|
||||
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.dto.chart.FilterParamTO;
|
||||
import io.dataease.service.chart.FilterBuildTemplate;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public abstract class TimeBuild extends FilterBuildTemplate {
|
||||
|
||||
private static final String MULTIPLETYPE = "daterange";
|
||||
|
||||
@Override
|
||||
protected FilterParamTO buildParam(Map<String, Object> component) {
|
||||
FilterParamTO result = new FilterParamTO();
|
||||
result.setComponent(component);
|
||||
result.setValue(null);
|
||||
result.setOperator("between");
|
||||
result.setIsTree(false);
|
||||
|
||||
Map<String, Object> options = (Map<String, Object>) component.get("options");
|
||||
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
|
||||
Object valueObj = options.get("value");
|
||||
String defaultValue = "";
|
||||
boolean multiple = attrs.get("type").equals(MULTIPLETYPE);
|
||||
Object defaultObject = attrs.get("default");
|
||||
Boolean isDynamic = false;
|
||||
if (ObjectUtils.isNotEmpty(defaultObject)) {
|
||||
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
|
||||
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
|
||||
}
|
||||
|
||||
List<String> realValues = null;
|
||||
|
||||
if (!ObjectUtils.isEmpty(valueObj)) {
|
||||
if (valueObj instanceof List) {
|
||||
defaultValue = "";
|
||||
} else {
|
||||
defaultValue = valueObj.toString();
|
||||
}
|
||||
}
|
||||
String componentType = componentType(component);
|
||||
String labelFormat = labelFormat(component);
|
||||
if (isDynamic) {
|
||||
List<Long> dynamicTimes = dynamicDateFromNow(component);
|
||||
if (CollectionUtils.isNotEmpty(dynamicTimes)) {
|
||||
int size = dynamicTimes.size();
|
||||
if (size > 1) {
|
||||
String start = timeSection(String.valueOf(dynamicTimes.get(0)), multiple ? "datetime" : componentType, labelFormat).get(0);
|
||||
String end = timeSection(String.valueOf(dynamicTimes.get(1)), multiple ? "datetime" : componentType, labelFormat).get(1);
|
||||
realValues = add2List(start, end);
|
||||
} else {
|
||||
realValues = timeSection(String.valueOf(dynamicTimes.get(0)), componentType, labelFormat);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (StringUtils.isBlank(defaultValue)) {
|
||||
realValues = new ArrayList<>();
|
||||
} else {
|
||||
if (multiple) {
|
||||
List<String> realVals = Arrays.asList(defaultValue.split(","));
|
||||
String start = realVals.get(0);
|
||||
String end = realVals.get(1);
|
||||
start = timeSection(start, "datetime", labelFormat).get(0);
|
||||
end = timeSection(end, "datetime", labelFormat).get(1);
|
||||
realValues = add2List(start, end);
|
||||
} else {
|
||||
realValues = Arrays.asList(defaultValue.split(",")).stream().limit(1).collect(Collectors.toList());
|
||||
realValues = timeSection(realValues.get(0), componentType, labelFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
result.setValue(realValues);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<String> timeSection(String sourceTimeStr, String type, String labelFormat) {
|
||||
if (StringUtils.isBlank(sourceTimeStr)) return null;
|
||||
Long sourceTime = Long.parseLong(sourceTimeStr);
|
||||
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
List<String> formatArr = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(labelFormat)) {
|
||||
formatArr = Arrays.stream(labelFormat.split(" ")).collect(Collectors.toList());
|
||||
}
|
||||
Integer[] fieldNames = {Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND};
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTimeInMillis(sourceTime);
|
||||
int methodsLen = fieldNames.length;
|
||||
int childArrLength = 0;
|
||||
if (StringUtils.equals("datetime", type) && formatArr.size() > 1) {
|
||||
List<String> childArr = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(formatArr.get(1))) {
|
||||
childArr = Arrays.stream(formatArr.get(1).split(":")).collect(Collectors.toList());
|
||||
}
|
||||
childArrLength = childArr.size();
|
||||
while (--methodsLen >= childArrLength) {
|
||||
executeSetFieldValue(instance, fieldNames[methodsLen], 0);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < methodsLen; i++) {
|
||||
executeSetFieldValue(instance, fieldNames[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
Calendar endInstance = Calendar.getInstance();
|
||||
endInstance.setTimeInMillis(instance.getTimeInMillis());
|
||||
if (StringUtils.equals("year", type)) {
|
||||
instance.set(Calendar.MONTH, 0);
|
||||
instance.set(Calendar.DATE, 1);
|
||||
endInstance.setTimeInMillis(instance.getTimeInMillis());
|
||||
endInstance.set(Calendar.YEAR, endInstance.get(Calendar.YEAR) + 1);
|
||||
endInstance.add(Calendar.SECOND, -1);
|
||||
endInstance.roll(Calendar.MILLISECOND, -1);
|
||||
|
||||
}
|
||||
|
||||
if (StringUtils.equals("month", type)) {
|
||||
instance.set(Calendar.DATE, 1);
|
||||
endInstance.setTimeInMillis(instance.getTimeInMillis());
|
||||
endInstance.set(Calendar.MONTH, endInstance.get(Calendar.MONTH) + 1);
|
||||
endInstance.add(Calendar.SECOND, -1);
|
||||
endInstance.roll(Calendar.MILLISECOND, -1);
|
||||
}
|
||||
|
||||
if (StringUtils.equals("date", type)) {
|
||||
endInstance.set(Calendar.DATE, endInstance.get(Calendar.DATE) + 1);
|
||||
endInstance.add(Calendar.SECOND, -1);
|
||||
endInstance.roll(Calendar.MILLISECOND, -1);
|
||||
}
|
||||
|
||||
if (StringUtils.equals("datetime", type)) {
|
||||
if (childArrLength == 0) {
|
||||
endInstance.set(Calendar.DATE, endInstance.get(Calendar.DATE) + 1);
|
||||
} else {
|
||||
Integer fieldNameFlag = fieldNames[childArrLength - 1];
|
||||
endInstance.set(fieldNameFlag, endInstance.get(fieldNameFlag) + 1);
|
||||
}
|
||||
endInstance.add(Calendar.SECOND, -1);
|
||||
endInstance.roll(Calendar.MILLISECOND, -1);
|
||||
}
|
||||
|
||||
result.add(String.valueOf(instance.getTimeInMillis()));
|
||||
result.add(String.valueOf(endInstance.getTimeInMillis()));
|
||||
return result;
|
||||
}
|
||||
|
||||
private void executeSetFieldValue(Calendar instance, Integer fieldFlag, Object value) {
|
||||
try {
|
||||
Method setMethod = instance.getClass().getMethod("set", int.class, int.class);
|
||||
setMethod.invoke(instance, fieldFlag, value);
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean isTimeWidget(String serviceName) {
|
||||
if (StringUtils.isBlank(serviceName)) return false;
|
||||
String[] timeWidgets = {"timeDateWidget", "timeDateRangeWidget"};
|
||||
return Arrays.stream(timeWidgets).anyMatch(widget -> StringUtils.equals(widget, serviceName));
|
||||
}
|
||||
|
||||
public Boolean showTime(Map<String, Object> component) {
|
||||
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
|
||||
if (ObjectUtils.isNotEmpty(attrs.get("showTime"))) {
|
||||
return (boolean) attrs.get("showTime");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String componentType(Map<String, Object> component) {
|
||||
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
|
||||
String result = ObjectUtils.isEmpty(attrs.get("type")) ? "date" : attrs.get("type").toString();
|
||||
String serviceName = component.get("serviceName").toString();
|
||||
if (isTimeWidget(serviceName) && showTime(component)) {
|
||||
result = StringUtils.equals("timeDateWidget", serviceName) ? "datetime" : "datetimerange";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String labelFormat(Map<String, Object> component) {
|
||||
String result = "yyyy-MM-dd";
|
||||
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
|
||||
String serviceName = component.get("serviceName").toString();
|
||||
if (isTimeWidget(serviceName) && showTime(component) && ObjectUtils.isNotEmpty(attrs.get("accuracy"))) {
|
||||
return result + " " + attrs.get("accuracy");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List add2List(Object... elements) {
|
||||
return Arrays.stream(elements).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public abstract List<Long> dynamicDateFromNow(Map<String, Object> component);
|
||||
|
||||
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package io.dataease.service.chart.build;
|
||||
|
||||
import io.dataease.dto.chart.FilterParamTO;
|
||||
import io.dataease.service.chart.FilterBuildTemplate;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public class TimeYearBuild extends FilterBuildTemplate {
|
||||
@Override
|
||||
protected FilterParamTO buildParam(Map<String, Object> component) {
|
||||
List<String> realVals = null;
|
||||
Object valueObj = null;
|
||||
String defaultValue = "";
|
||||
Map<String, Object> options = (Map<String, Object>) component.get("options");
|
||||
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
|
||||
Object aDefault = attrs.get("default");
|
||||
Boolean isDynamic = (Boolean) attrs.getOrDefault("isDynamic", false);
|
||||
if (ObjectUtils.isNotEmpty(aDefault) && isDynamic) {
|
||||
Long aLong = dynamicDateFormNow(component);
|
||||
realVals = new ArrayList<>();
|
||||
realVals.add(aLong.toString());
|
||||
}else {
|
||||
if(!ObjectUtils.isEmpty(valueObj)) {
|
||||
if(valueObj instanceof List) {
|
||||
defaultValue = "";
|
||||
}else {
|
||||
defaultValue = valueObj.toString();
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(defaultValue)) {
|
||||
realVals = new ArrayList<>();
|
||||
}else {
|
||||
realVals = Arrays.asList(defaultValue.split(",")).stream().limit(1).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Long dynamicDateFormNow(Map<String, Object> component) {
|
||||
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
|
||||
Object aDefault = attrs.get("default");
|
||||
Boolean isDynamic = (Boolean) attrs.getOrDefault("isDynamic", false);
|
||||
if (ObjectUtils.isEmpty(aDefault) || !isDynamic) return null;
|
||||
|
||||
Calendar now = Calendar.getInstance();
|
||||
int nowYear = now.get(Calendar.YEAR);
|
||||
Map<String, Object> aDefaultMap = (Map<String, Object>) aDefault;
|
||||
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 0){
|
||||
now.set(nowYear, 0, 1, 0, 0, 0);
|
||||
return now.getTimeInMillis();
|
||||
}
|
||||
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 1){
|
||||
now.set(nowYear - 1, 0, 1, 0, 0, 0);
|
||||
return now.getTimeInMillis();
|
||||
}
|
||||
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 2){
|
||||
int dynamicPrefix = Integer.parseInt(aDefaultMap.get("dynamicPrefix").toString());
|
||||
String dynamicSuffix = aDefaultMap.get("dynamicSuffix").toString();
|
||||
now.set(StringUtils.equals("before", dynamicSuffix) ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1, 0, 0, 0);
|
||||
return now.getTimeInMillis();
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package io.dataease.service.chart.build.time;
|
||||
|
||||
import io.dataease.service.chart.build.TimeBuild;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("timeDateWidget")
|
||||
public class TimeDateBuild extends TimeBuild {
|
||||
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
|
||||
Map<String, Object> attrs = buildAttrs(component);
|
||||
Object defaultObject = attrs.get("default");
|
||||
|
||||
Boolean isDynamic = false;
|
||||
Map<String, Object> defaultMap = null;
|
||||
if (ObjectUtils.isNotEmpty(defaultObject)) {
|
||||
defaultMap = (Map<String, Object>) defaultObject;
|
||||
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
|
||||
}
|
||||
if (ObjectUtils.isEmpty(defaultObject) || !isDynamic) return null;
|
||||
|
||||
Calendar now = Calendar.getInstance();
|
||||
int nowYear = now.get(Calendar.YEAR);
|
||||
int nowMonth = now.get(Calendar.MONTH);
|
||||
int nowDate = now.get(Calendar.DATE);
|
||||
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
|
||||
if (dkey == 0) {
|
||||
now.set(nowYear, nowMonth, nowDate, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 1) {
|
||||
now.set(nowYear, nowMonth, nowDate - 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
|
||||
if (dkey == 2) {
|
||||
now.set(nowYear, nowMonth, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
|
||||
if (dkey == 4) {
|
||||
now.set(nowYear, 0, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
|
||||
if (dkey == 3) {
|
||||
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
|
||||
String dynamicInfill = defaultMap.get("dynamicInfill").toString();
|
||||
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
|
||||
now.set(nowYear, nowMonth, nowDate, 0, 0, 0);
|
||||
if (StringUtils.equals("day", dynamicInfill)) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.roll(Calendar.DATE, step);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (StringUtils.equals("week", dynamicInfill)) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1) * 7;
|
||||
now.roll(Calendar.DATE, step);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (StringUtils.equals("month", dynamicInfill)) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.roll(Calendar.MONTH, step);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (StringUtils.equals("year", dynamicInfill)) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.roll(Calendar.YEAR, step);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,149 @@
|
||||
package io.dataease.service.chart.build.time;
|
||||
|
||||
import io.dataease.service.chart.build.TimeBuild;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("timeDateRangeWidget")
|
||||
public class TimeDateRangeBuild extends TimeBuild {
|
||||
@Override
|
||||
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
|
||||
|
||||
Map<String, Object> attrs = buildAttrs(component);
|
||||
Object defaultObject = null;
|
||||
if ((defaultObject = attrs.get("default")) == null) return null;
|
||||
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
|
||||
|
||||
Boolean isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
|
||||
if (!isDynamic) return null;
|
||||
|
||||
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
|
||||
Calendar now = Calendar.getInstance();
|
||||
now.set(Calendar.HOUR_OF_DAY, 0);
|
||||
now.set(Calendar.MINUTE, 0);
|
||||
now.set(Calendar.SECOND, 0);
|
||||
now.set(Calendar.MILLISECOND, 0);
|
||||
if (dkey % 5 == 0) {
|
||||
if (dkey == 5) {
|
||||
now.add(Calendar.DATE, -7);
|
||||
}
|
||||
now.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||
long start = now.getTimeInMillis();
|
||||
now.add(Calendar.DATE, 7);
|
||||
now.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
||||
long end = now.getTimeInMillis();
|
||||
return add2List(start, end);
|
||||
}
|
||||
|
||||
if (dkey == 1) {
|
||||
Calendar endBase = (Calendar) now.clone();
|
||||
now.set(Calendar.DAY_OF_MONTH, 1);
|
||||
long start = now.getTimeInMillis();
|
||||
endBase.add(Calendar.MONTH, 1);
|
||||
endBase.set(Calendar.DAY_OF_MONTH, 0);
|
||||
long end = endBase.getTimeInMillis();
|
||||
return add2List(start, end);
|
||||
}
|
||||
if (dkey == 6) {
|
||||
Calendar endBase = (Calendar) now.clone();
|
||||
now.add(Calendar.MONTH, -1);
|
||||
now.set(Calendar.DAY_OF_MONTH, 1);
|
||||
long start = now.getTimeInMillis();
|
||||
endBase.set(Calendar.DAY_OF_MONTH, 0);
|
||||
long end = endBase.getTimeInMillis();
|
||||
return add2List(start, end);
|
||||
}
|
||||
|
||||
if (dkey % 5 == 2) {
|
||||
int step = 0;
|
||||
if (dkey == 7) {
|
||||
step = -1;
|
||||
}
|
||||
Calendar endBase = (Calendar) now.clone();
|
||||
Long start = quarterBegin(now, step);
|
||||
Long end = quarterEnd(endBase, step);
|
||||
return add2List(start, end);
|
||||
}
|
||||
|
||||
if (dkey == 3) {
|
||||
now.set(Calendar.MONTH, 0);
|
||||
now.set(Calendar.DAY_OF_MONTH, 1);
|
||||
long start = now.getTimeInMillis();
|
||||
now.add(Calendar.YEAR, 1);
|
||||
now.add(Calendar.DAY_OF_MONTH, -1);
|
||||
long end = now.getTimeInMillis();
|
||||
return add2List(start, end);
|
||||
}
|
||||
if (dkey == 8) {
|
||||
now.add(Calendar.YEAR, -1);
|
||||
now.set(Calendar.MONTH, 0);
|
||||
now.set(Calendar.DAY_OF_MONTH, 1);
|
||||
long start = now.getTimeInMillis();
|
||||
now.add(Calendar.YEAR, 1);
|
||||
now.add(Calendar.DAY_OF_MONTH, -1);
|
||||
long end = now.getTimeInMillis();
|
||||
return add2List(start, end);
|
||||
}
|
||||
|
||||
if (dkey == 4) {
|
||||
Object startDynamicObject = defaultMap.get("sDynamicPrefix");
|
||||
Object endDynamicObject = defaultMap.get("eDynamicPrefix");
|
||||
if (ObjectUtils.isNotEmpty(startDynamicObject) && ObjectUtils.isNotEmpty(endDynamicObject)) {
|
||||
String startDynamicInfill = defaultMap.get("sDynamicInfill").toString();
|
||||
String endDynamicInfill = defaultMap.get("eDynamicInfill").toString();
|
||||
String startDynamicSuffix = defaultMap.get("sDynamicSuffix").toString();
|
||||
String endDynamicSuffix = defaultMap.get("eDynamicSuffix").toString();
|
||||
int startDynamic = (int) Double.parseDouble(startDynamicObject.toString());
|
||||
int endDynamic = (int) Double.parseDouble(endDynamicObject.toString());
|
||||
Calendar endBase = (Calendar) now.clone();
|
||||
Long start = customTime(now, startDynamic, startDynamicInfill, startDynamicSuffix);
|
||||
Long end = customTime(endBase, endDynamic, endDynamicInfill, endDynamicSuffix);
|
||||
return add2List(start, end);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Long customTime(Calendar now, int dynamicPrefix, String dynamicInfill, String dynamicSuffix) {
|
||||
if (StringUtils.equals(dynamicInfill, "day")) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.add(Calendar.DAY_OF_MONTH, step);
|
||||
}
|
||||
if (StringUtils.equals(dynamicInfill, "week")) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1) * 7;
|
||||
now.add(Calendar.DAY_OF_MONTH, step);
|
||||
}
|
||||
if (StringUtils.equals(dynamicInfill, "month")) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.add(Calendar.MONTH, step);
|
||||
}
|
||||
if (StringUtils.equals("year", dynamicInfill)) {
|
||||
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
|
||||
now.add(Calendar.YEAR, step);
|
||||
}
|
||||
return now.getTimeInMillis();
|
||||
}
|
||||
|
||||
private Long quarterBegin(Calendar instance, int step) {
|
||||
int month = instance.get(Calendar.MONTH);
|
||||
int quarterBegin = (int) Math.floor(month / 3) * 3;
|
||||
instance.set(Calendar.MONTH, quarterBegin + (3 * step));
|
||||
instance.set(Calendar.DAY_OF_MONTH, 1);
|
||||
return instance.getTimeInMillis();
|
||||
}
|
||||
|
||||
private Long quarterEnd(Calendar instance, int step) {
|
||||
int month = instance.get(Calendar.MONTH);
|
||||
int quarterBegin = (int) Math.floor(month / 3) * 3;
|
||||
instance.set(Calendar.MONTH, quarterBegin + (3 * (step + 1)));
|
||||
instance.set(Calendar.DAY_OF_MONTH, 1);
|
||||
instance.add(Calendar.DATE, -1);
|
||||
return instance.getTimeInMillis();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package io.dataease.service.chart.build.time;
|
||||
|
||||
import io.dataease.service.chart.build.TimeBuild;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("timeMonthWidget")
|
||||
public class TimeMonthBuild extends TimeBuild {
|
||||
@Override
|
||||
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
|
||||
Map<String, Object> attrs = buildAttrs(component);
|
||||
|
||||
Object defaultObject = attrs.get("default");
|
||||
|
||||
if (ObjectUtils.isEmpty(defaultObject)) return null;
|
||||
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
|
||||
|
||||
Boolean isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
|
||||
if (!isDynamic) return null;
|
||||
Calendar now = Calendar.getInstance();
|
||||
int nowYear = now.get(Calendar.YEAR);
|
||||
int nowMonth = now.get(Calendar.MONTH);
|
||||
|
||||
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
|
||||
if (dkey == 0) {
|
||||
now.set(nowYear, nowMonth, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 1) {
|
||||
now.set(nowYear, nowMonth - 1, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 2) {
|
||||
now.set(nowYear, 0, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 4) {
|
||||
now.set(nowYear - 1, nowMonth, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 3) {
|
||||
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
|
||||
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
|
||||
int targetMonth = StringUtils.equals("before", dynamicSuffix) ? (nowMonth - dynamicPrefix) : (nowMonth + dynamicPrefix);
|
||||
now.set(nowYear, targetMonth, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package io.dataease.service.chart.build.time;
|
||||
|
||||
import io.dataease.service.chart.build.TimeBuild;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("timeYearWidget")
|
||||
public class TimeYearBuild extends TimeBuild {
|
||||
@Override
|
||||
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
|
||||
|
||||
Boolean isDynamic = false;
|
||||
Map<String, Object> defaultMap = null;
|
||||
Map<String, Object> attrs = buildAttrs(component);
|
||||
Object defaultObject = attrs.get("default");
|
||||
if (ObjectUtils.isNotEmpty(defaultObject)) {
|
||||
defaultMap = (Map<String, Object>) defaultObject;
|
||||
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
|
||||
}
|
||||
if (ObjectUtils.isEmpty(defaultObject) || !isDynamic) return null;
|
||||
|
||||
Calendar now = Calendar.getInstance();
|
||||
int nowYear = now.get(Calendar.YEAR);
|
||||
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
|
||||
if (dkey == 0) {
|
||||
now.set(nowYear, 0, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 1) {
|
||||
now.set(nowYear - 1, 0, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
if (dkey == 2) {
|
||||
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
|
||||
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
|
||||
now.set(StringUtils.equals("before", dynamicSuffix) ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1, 0, 0, 0);
|
||||
return add2List(now.getTimeInMillis());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -510,7 +510,7 @@ public class DataSetTableService {
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
datasourceRequest.setTable(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable());
|
||||
return datasourceProvider.getTableFileds(datasourceRequest);
|
||||
return datasourceProvider.getTableFields(datasourceRequest);
|
||||
}
|
||||
|
||||
public Map<String, List<DatasetTableField>> getFieldsFromDE(DataSetTableRequest dataSetTableRequest)
|
||||
|
||||
@ -153,14 +153,13 @@
|
||||
<div class="dataset">
|
||||
<span class="name">{{ $t('dataset.name') }}</span>
|
||||
<el-input
|
||||
v-if="activeIndex !== -1"
|
||||
v-model="tableData[activeIndex].datasetName"
|
||||
v-model="activeTable.datasetName"
|
||||
size="small"
|
||||
clearable
|
||||
@change="validateName"
|
||||
/>
|
||||
<div
|
||||
v-if="tableData[activeIndex].nameExsit"
|
||||
v-if="activeTable.nameExsit"
|
||||
style="left: 107px; top: 52px"
|
||||
class="el-form-item__error"
|
||||
>
|
||||
@ -257,15 +256,13 @@ export default {
|
||||
avilibelTable: false,
|
||||
noAvilibelTableImg: require('@/assets/None.png'),
|
||||
noSelectTable: require('@/assets/None_Select_ds.png'),
|
||||
activeTable: {},
|
||||
activeName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
activeIndex() {
|
||||
return this.tableData.findIndex((ele) => ele.name === this.activeName)
|
||||
},
|
||||
checkDatasetName() {
|
||||
return this.tableData
|
||||
return this.tables
|
||||
.filter((ele, index) => {
|
||||
return this.checkTableList.includes(ele.name)
|
||||
})
|
||||
@ -285,11 +282,11 @@ export default {
|
||||
const dsName = this.options.find((ele) => ele.id === val).name
|
||||
post('/datasource/getTables/' + val, {}).then((response) => {
|
||||
this.tables = response.data
|
||||
this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
this.tableData.forEach((ele) => {
|
||||
this.tables.forEach((ele) => {
|
||||
this.$set(ele, 'datasetName', dsName + '_' + ele.name)
|
||||
this.$set(ele, 'nameExsit', false)
|
||||
})
|
||||
this.tableData = [...this.tables]
|
||||
this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck)
|
||||
}).finally(() => {
|
||||
this.dsLoading = false
|
||||
@ -302,18 +299,15 @@ export default {
|
||||
}
|
||||
},
|
||||
searchTable(val) {
|
||||
this.activeName = ''
|
||||
if (val && val !== '') {
|
||||
this.tableData = JSON.parse(
|
||||
JSON.stringify(
|
||||
this.tables.filter((ele) => {
|
||||
return ele.name
|
||||
.toLocaleLowerCase()
|
||||
.includes(val.toLocaleLowerCase())
|
||||
})
|
||||
)
|
||||
)
|
||||
this.tableData = [...this.tables.filter((ele) => {
|
||||
return ele.name
|
||||
.toLocaleLowerCase()
|
||||
.includes(val.toLocaleLowerCase())
|
||||
})]
|
||||
} else {
|
||||
this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
this.tableData = [...this.tables]
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -355,17 +349,17 @@ export default {
|
||||
}
|
||||
this.LeftWidth = e.pageX
|
||||
},
|
||||
nameExsitValidator(activeIndex) {
|
||||
this.tableData[activeIndex].nameExsit =
|
||||
nameExsitValidator(ele) {
|
||||
ele.nameExsit =
|
||||
this.nameList
|
||||
.concat(this.checkDatasetName)
|
||||
.filter((name) => name === this.tableData[activeIndex].datasetName)
|
||||
.filter((name) => name === ele.datasetName)
|
||||
.length > 1
|
||||
},
|
||||
validateName() {
|
||||
this.tableData.forEach((ele, index) => {
|
||||
if (this.checkDatasetName.includes(ele.datasetName)) {
|
||||
this.nameExsitValidator(index)
|
||||
this.tables.forEach((ele, index) => {
|
||||
if (this.checkTableList.includes(ele.name)) {
|
||||
this.nameExsitValidator(ele)
|
||||
} else {
|
||||
ele.nameExsit = false
|
||||
}
|
||||
@ -381,6 +375,7 @@ export default {
|
||||
setActiveName({ name, datasourceId, enableCheck }) {
|
||||
if (!enableCheck) return
|
||||
this.activeName = name
|
||||
this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {}
|
||||
this.dbPreview({
|
||||
dataSourceId: datasourceId,
|
||||
info: JSON.stringify({ table: name })
|
||||
@ -428,7 +423,7 @@ export default {
|
||||
const mode = this.mode
|
||||
const syncType = this.syncType
|
||||
this.checkTableList.forEach((name) => {
|
||||
const datasetName = this.tableData.find(
|
||||
const datasetName = this.tables.find(
|
||||
(ele) => ele.name === name
|
||||
).datasetName
|
||||
tables.push({
|
||||
@ -449,13 +444,6 @@ export default {
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
dataReset() {
|
||||
this.searchTable = ''
|
||||
this.options = []
|
||||
this.dataSource = ''
|
||||
this.tables = []
|
||||
this.checkTableList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,14 +160,13 @@
|
||||
<div class="dataset">
|
||||
<span class="name">{{ $t('dataset.name') }}</span>
|
||||
<el-input
|
||||
v-if="activeIndex !== -1"
|
||||
v-model="tableData[activeIndex].datasetName"
|
||||
v-model="activeTable.datasetName"
|
||||
size="small"
|
||||
clearable
|
||||
@change="validateName"
|
||||
/>
|
||||
<div
|
||||
v-if="tableData[activeIndex].nameExsit"
|
||||
v-if="activeTable.nameExsit"
|
||||
style="left: 107px; top: 52px"
|
||||
class="el-form-item__error"
|
||||
>
|
||||
@ -263,15 +262,13 @@ export default {
|
||||
avilibelTable: false,
|
||||
noAvilibelTableImg: require('@/assets/None.png'),
|
||||
noSelectTable: require('@/assets/None_Select_ds.png'),
|
||||
activeTable: {},
|
||||
activeName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
activeIndex() {
|
||||
return this.tableData.findIndex((ele) => ele.name === this.activeName)
|
||||
},
|
||||
checkDatasetName() {
|
||||
return this.tableData
|
||||
return this.tables
|
||||
.filter((ele, index) => {
|
||||
return this.checkTableList.includes(ele.name)
|
||||
})
|
||||
@ -288,14 +285,15 @@ export default {
|
||||
this.dsLoading = true
|
||||
this.checkTableList = []
|
||||
this.activeName = ''
|
||||
this.activeTable = {}
|
||||
const dsName = this.options.find((ele) => ele.id === val).name
|
||||
post('/datasource/getTables/' + val, {}).then((response) => {
|
||||
this.tables = response.data
|
||||
this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
this.tableData.forEach((ele) => {
|
||||
this.tables.forEach((ele) => {
|
||||
this.$set(ele, 'datasetName', dsName + '_' + ele.name)
|
||||
this.$set(ele, 'nameExsit', false)
|
||||
})
|
||||
this.tableData = [...this.tables]
|
||||
this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck)
|
||||
}).finally(() => {
|
||||
this.dsLoading = false
|
||||
@ -318,18 +316,15 @@ export default {
|
||||
}
|
||||
},
|
||||
searchTable(val) {
|
||||
this.activeName = ''
|
||||
if (val && val !== '') {
|
||||
this.tableData = JSON.parse(
|
||||
JSON.stringify(
|
||||
this.tables.filter((ele) => {
|
||||
return ele.name
|
||||
.toLocaleLowerCase()
|
||||
.includes(val.toLocaleLowerCase())
|
||||
})
|
||||
)
|
||||
)
|
||||
this.tableData = [...this.tables.filter((ele) => {
|
||||
return ele.name
|
||||
.toLocaleLowerCase()
|
||||
.includes(val.toLocaleLowerCase())
|
||||
})]
|
||||
} else {
|
||||
this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
this.tableData = [...this.tables]
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -371,17 +366,17 @@ export default {
|
||||
}
|
||||
this.LeftWidth = e.pageX
|
||||
},
|
||||
nameExsitValidator(activeIndex) {
|
||||
this.tableData[activeIndex].nameExsit =
|
||||
nameExsitValidator(ele) {
|
||||
ele.nameExsit =
|
||||
this.nameList
|
||||
.concat(this.checkDatasetName)
|
||||
.filter((name) => name === this.tableData[activeIndex].datasetName)
|
||||
.filter((name) => name === ele.datasetName)
|
||||
.length > 1
|
||||
},
|
||||
validateName() {
|
||||
this.tableData.forEach((ele, index) => {
|
||||
if (this.checkDatasetName.includes(ele.datasetName)) {
|
||||
this.nameExsitValidator(index)
|
||||
this.tables.forEach((ele, index) => {
|
||||
if (this.checkTableList.includes(ele.name)) {
|
||||
this.nameExsitValidator(ele)
|
||||
} else {
|
||||
ele.nameExsit = false
|
||||
}
|
||||
@ -410,6 +405,7 @@ export default {
|
||||
setActiveName({ name, datasourceId, enableCheck }) {
|
||||
if (!enableCheck) return
|
||||
this.activeName = name
|
||||
this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {}
|
||||
this.dbPreview({
|
||||
dataSourceId: datasourceId,
|
||||
info: JSON.stringify({ table: name })
|
||||
@ -444,7 +440,7 @@ export default {
|
||||
const mode = this.mode
|
||||
const syncType = this.syncType
|
||||
this.checkTableList.forEach((name) => {
|
||||
const datasetName = this.tableData.find(
|
||||
const datasetName = this.tables.find(
|
||||
(ele) => ele.name === name
|
||||
).datasetName
|
||||
tables.push({
|
||||
@ -465,13 +461,6 @@ export default {
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
dataReset() {
|
||||
this.searchTable = ''
|
||||
this.options = []
|
||||
this.dataSource = ''
|
||||
this.tables = []
|
||||
this.checkTableList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ export default {
|
||||
errMsgCont: '',
|
||||
options: [],
|
||||
sql: '',
|
||||
dataReference: false,
|
||||
dataReference: true,
|
||||
sqlOption: {
|
||||
tabSize: 2,
|
||||
styleActiveLine: true,
|
||||
|
||||
@ -551,7 +551,9 @@
|
||||
<el-input
|
||||
v-if="scope.row.deType === 1"
|
||||
v-model="scope.row.dateFormat"
|
||||
size="mini"
|
||||
:placeholder="$t('dataset.date_format')"
|
||||
size="small"
|
||||
class="input-type"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
@blur="saveEdit(scope.row)"
|
||||
@keyup.enter.native="saveEdit(scope.row)"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-col style="padding: 0 5px 0 5px;">
|
||||
<el-row>
|
||||
<el-row class="de-tree">
|
||||
<span class="header-title">{{ $t('panel.share_in') }}</span>
|
||||
<div
|
||||
class="block"
|
||||
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-row class="de-tree">
|
||||
<span class="header-title">{{ $t('panel.share_out') }}</span>
|
||||
<div
|
||||
class="block"
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@execute-axios="executeAxios"
|
||||
@on-add-languanges="addLanguages"
|
||||
@on-add-languages="addLanguages"
|
||||
@plugin-call-back="pluginCallBack"
|
||||
/>
|
||||
<div v-else>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
v-if="showAsync"
|
||||
:url="url"
|
||||
@execute-axios="executeAxios"
|
||||
@on-add-languanges="addLanguages"
|
||||
@on-add-languages="addLanguages"
|
||||
@on-plugin-layout="setLayoutInfo"
|
||||
@plugin-call-back="pluginCallBack"
|
||||
/>
|
||||
@ -22,7 +22,7 @@
|
||||
v-if="showAsync"
|
||||
:url="url"
|
||||
@execute-axios="executeAxios"
|
||||
@on-add-languanges="addLanguages"
|
||||
@on-add-languages="addLanguages"
|
||||
@on-plugin-layout="setLayoutInfo"
|
||||
@plugin-call-back="pluginCallBack"
|
||||
/>
|
||||
@ -35,7 +35,7 @@
|
||||
v-if="showAsync"
|
||||
:url="url"
|
||||
@execute-axios="executeAxios"
|
||||
@on-add-languanges="addLanguages"
|
||||
@on-add-languages="addLanguages"
|
||||
@on-plugin-layout="setLayoutInfo"
|
||||
@plugin-call-back="pluginCallBack"
|
||||
/>
|
||||
|
||||
@ -241,7 +241,6 @@ export default {
|
||||
originLoginType: null
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
beforeCreate() {
|
||||
ldapStatus().then((res) => {
|
||||
if (res.success && res.data) {
|
||||
@ -392,7 +391,7 @@ export default {
|
||||
updateInfo(param).then((response) => {
|
||||
const flag = response.success
|
||||
if (flag) {
|
||||
if (response.data && response.data.needLogout) {
|
||||
if (response.data?.needLogout) {
|
||||
const casEnable = response.data.casEnable
|
||||
bus.$emit('sys-logout', { casEnable })
|
||||
return
|
||||
|
||||
@ -132,6 +132,7 @@ import { emailInfo, updateInfo, validate } from '@/api/system/email'
|
||||
import operater from './Operater'
|
||||
import msgCfm from '@/components/msgCfm'
|
||||
import dePwd from '@/components/deCustomCm/dePwd.vue'
|
||||
const list = ['host', 'port', 'account', 'password', 'ssl', 'tls', '', 'recipient']
|
||||
export default {
|
||||
name: 'EmailSetting',
|
||||
components: {
|
||||
@ -192,28 +193,18 @@ export default {
|
||||
})
|
||||
},
|
||||
change() {
|
||||
if (
|
||||
!this.formInline.host ||
|
||||
const result = !this.formInline.host ||
|
||||
!this.formInline.port ||
|
||||
!this.formInline.account
|
||||
) {
|
||||
this.disabledConnection = true
|
||||
this.disabledSave = true
|
||||
} else {
|
||||
this.disabledConnection = false
|
||||
this.disabledSave = false
|
||||
}
|
||||
this.disabledConnection = result
|
||||
this.disabledSave = result
|
||||
},
|
||||
testConnection(formInline) {
|
||||
const param = {
|
||||
'smtp.host': this.formInline.host,
|
||||
'smtp.port': this.formInline.port,
|
||||
'smtp.account': this.formInline.account,
|
||||
'smtp.password': this.formInline.password,
|
||||
'smtp.ssl': this.formInline.ssl,
|
||||
'smtp.tls': this.formInline.tls,
|
||||
'smtp.recipient': this.formInline.recipient
|
||||
}
|
||||
const param = list.reduce((pre, next) => {
|
||||
if (!next) return pre
|
||||
pre[`smtp.${next}`] = this.formInline[next]
|
||||
return pre
|
||||
}, {})
|
||||
this.$refs[formInline].validate((valid) => {
|
||||
if (valid) {
|
||||
validate(param).then((response) => {
|
||||
@ -235,50 +226,16 @@ export default {
|
||||
this.showCancel = false
|
||||
this.showSave = false
|
||||
this.show = true
|
||||
const param = [
|
||||
{
|
||||
paramKey: 'smtp.host',
|
||||
paramValue: this.formInline.host,
|
||||
const param = list.reduce((pre, next, index) => {
|
||||
if (!next) return pre
|
||||
pre.push({
|
||||
paramKey: `smtp.${next}`,
|
||||
paramValue: this.formInline[next],
|
||||
type: 'text',
|
||||
sort: 1
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.port',
|
||||
paramValue: this.formInline.port,
|
||||
type: 'text',
|
||||
sort: 2
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.account',
|
||||
paramValue: this.formInline.account,
|
||||
type: 'text',
|
||||
sort: 3
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.password',
|
||||
paramValue: this.formInline.password,
|
||||
type: 'password',
|
||||
sort: 4
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.ssl',
|
||||
paramValue: this.formInline.ssl,
|
||||
type: 'text',
|
||||
sort: 5
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.tls',
|
||||
paramValue: this.formInline.tls,
|
||||
type: 'text',
|
||||
sort: 6
|
||||
},
|
||||
{
|
||||
paramKey: 'smtp.recipient',
|
||||
paramValue: this.formInline.recipient,
|
||||
type: 'text',
|
||||
sort: 8
|
||||
}
|
||||
]
|
||||
sort: index + 1
|
||||
})
|
||||
return pre
|
||||
}, [])
|
||||
|
||||
this.$refs[formInline].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
@ -47,17 +47,17 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
class="text-btn"
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
@click="create(scope.row)"
|
||||
>{{ $t("commons.edit") }}</el-button>
|
||||
<el-button
|
||||
class="text-btn"
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
@click="validateById(scope.row)"
|
||||
>{{ $t("commons.validate") }}</el-button>
|
||||
<el-button
|
||||
class="text-btn"
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
@click="del(scope.row)"
|
||||
>{{
|
||||
@ -341,22 +341,6 @@ export default {
|
||||
.table-box {
|
||||
height: calc(100% - 52px);
|
||||
margin-top: 16px;
|
||||
|
||||
.text-btn {
|
||||
font-family: PingFang SC;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
letter-spacing: 0px;
|
||||
text-align: center;
|
||||
margin-left: 2px;
|
||||
border: none;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
.text-btn:hover {
|
||||
background: rgba(51, 112, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -118,12 +118,8 @@ export default {
|
||||
},
|
||||
|
||||
nodeClick(data, node) {
|
||||
let parent = null
|
||||
if (node.parent.data instanceof Array) {
|
||||
parent = node.parent.data[0]
|
||||
} else {
|
||||
parent = node.parent.data
|
||||
}
|
||||
const arr = node.parent?.data
|
||||
const parent = Array.isArray(arr) ? arr[0] : arr
|
||||
const nodeInfo = {
|
||||
code: data.code,
|
||||
name: data.name,
|
||||
@ -132,24 +128,20 @@ export default {
|
||||
}
|
||||
this.$emit('show-node-info', this.setStatus(nodeInfo, 'read-only'))
|
||||
},
|
||||
addHandler(data, node) {
|
||||
addHandler({ code: pCode }, { level: pLevel }) {
|
||||
let form = {
|
||||
pLevel: node.level,
|
||||
pCode: data.code
|
||||
pLevel,
|
||||
pCode
|
||||
}
|
||||
if (node.level > 4) {
|
||||
if (pLevel > 4) {
|
||||
this.$error('不支持4级行政级别')
|
||||
form = {}
|
||||
}
|
||||
this.$emit('emit-add', this.setStatus(form, 'add'))
|
||||
},
|
||||
removeHandler(data, node) {
|
||||
let parent = null
|
||||
if (node.parent.data instanceof Array) {
|
||||
parent = node.parent.data[0]
|
||||
} else {
|
||||
parent = node.parent.data
|
||||
}
|
||||
const arr = node.parent?.data
|
||||
const parent = Array.isArray(arr) ? arr[0] : arr
|
||||
const param = {
|
||||
code: data.code,
|
||||
pcode: parent.code,
|
||||
@ -185,10 +177,10 @@ export default {
|
||||
this.$refs.tree.setCurrentKey(code)
|
||||
},
|
||||
isChina(code) {
|
||||
return code && code.startsWith('156')
|
||||
return code?.startsWith('156')
|
||||
},
|
||||
isGlobal(code) {
|
||||
return code && code.startsWith('000')
|
||||
return code?.startsWith('000')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<!--基础配置表单-->
|
||||
<el-form
|
||||
v-if="status !== 'empty' && status !== 'read-only'"
|
||||
v-if="!status.includes['read-only', 'empty']"
|
||||
ref="formInline"
|
||||
v-loading="loading"
|
||||
:model="formInline"
|
||||
@ -10,11 +10,6 @@
|
||||
class="demo-form-inline"
|
||||
size="small"
|
||||
>
|
||||
<el-input
|
||||
v-show="false"
|
||||
v-model="formInline.pLevel"
|
||||
/>
|
||||
|
||||
<el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
@ -26,7 +21,7 @@
|
||||
v-if="treeShow"
|
||||
ref="deSelectTree"
|
||||
v-model="formInline.pCode"
|
||||
:popper-append-to-body="true"
|
||||
popper-append-to-body
|
||||
popover-class="map-class-wrap"
|
||||
:data="treeDatas"
|
||||
:select-params="selectParams"
|
||||
@ -107,7 +102,7 @@
|
||||
</el-button>
|
||||
<el-input
|
||||
v-model="formInline.fileName"
|
||||
:disabled="true"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -318,13 +313,13 @@ export default {
|
||||
},
|
||||
|
||||
loadForm(form) {
|
||||
if (form && form.code) {
|
||||
if (form?.code) {
|
||||
this.nodeInfo = JSON.parse(JSON.stringify(form))
|
||||
this.setGeoJson()
|
||||
}
|
||||
},
|
||||
setGeoJson() {
|
||||
if (!this.nodeInfo || !this.nodeInfo.code) {
|
||||
if (!this.nodeInfo?.code) {
|
||||
this.json = JSON.parse(JSON.stringify(this.noGsoJson))
|
||||
return
|
||||
}
|
||||
@ -348,9 +343,6 @@ export default {
|
||||
if (!value) return true
|
||||
return data.id.toString().indexOf(value.toString()) !== -1
|
||||
},
|
||||
// 树点击
|
||||
_nodeClickFun(data, node, vm) {
|
||||
},
|
||||
// 树过滤
|
||||
_searchFun(value) {
|
||||
this.$refs.deSelectTree.filterFun(value)
|
||||
|
||||
@ -51,28 +51,27 @@ export default {
|
||||
methods: {
|
||||
emitAdd(form) {
|
||||
this.setStatus(form.status)
|
||||
this.$refs && this.$refs['map_setting_form'] && this.$refs['map_setting_form'].emitAdd(form)
|
||||
this.$refs['map_setting_form']?.emitAdd(form)
|
||||
},
|
||||
|
||||
loadForm(nodeInfo) {
|
||||
this.setStatus(nodeInfo.status)
|
||||
this.$refs && this.$refs['map_setting_form'] && this.$refs['map_setting_form'].loadForm(nodeInfo)
|
||||
this.$refs['map_setting_form']?.loadForm(nodeInfo)
|
||||
},
|
||||
|
||||
setStatus(status) {
|
||||
this.formStatus = status
|
||||
},
|
||||
loadTreeData() {
|
||||
Object.keys(this.treeDatas).length === 0 && areaMapping().then(res => {
|
||||
!Object.keys(this.treeDatas).length && areaMapping().then(res => {
|
||||
this.treeDatas = res.data
|
||||
})
|
||||
},
|
||||
refreshTree(node) {
|
||||
areaMapping().then(res => {
|
||||
this.treeDatas = res.data
|
||||
if (node && node.code) {
|
||||
this.$refs && this.$refs['map_setting_tree'] && this.$refs['map_setting_tree'].showNewNode(node.code)
|
||||
}
|
||||
if (!node?.code) return
|
||||
this.$refs['map_setting_tree']?.showNewNode(node.code)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
<el-select
|
||||
v-model="form.type"
|
||||
:placeholder="$t('datasource.please_choose_type')"
|
||||
|
||||
filterable
|
||||
@change="changeType()"
|
||||
>
|
||||
@ -160,14 +159,10 @@ export default {
|
||||
port: '',
|
||||
extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull'
|
||||
},
|
||||
input: '',
|
||||
visible: true,
|
||||
showEdit: true,
|
||||
showSave: false,
|
||||
showCancel: false,
|
||||
show: true,
|
||||
disabledConnection: false,
|
||||
disabledSave: false,
|
||||
loading: false,
|
||||
rules: {
|
||||
'configuration.host': [
|
||||
@ -202,7 +197,6 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.query()
|
||||
},
|
||||
|
||||
@ -8,40 +8,40 @@
|
||||
class="de-tabs"
|
||||
>
|
||||
<el-tab-pane
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('system_parameter_setting.basic_setting')"
|
||||
name="zero"
|
||||
/>
|
||||
|
||||
<el-tab-pane
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('system_parameter_setting.mailbox_service_settings')"
|
||||
name="first"
|
||||
/>
|
||||
|
||||
<el-tab-pane
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('sysParams.map')"
|
||||
name="ten"
|
||||
/>
|
||||
|
||||
<el-tab-pane
|
||||
v-if="engineMode === 'simple'"
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('system_parameter_setting.engine_mode_setting')"
|
||||
name="six"
|
||||
/>
|
||||
|
||||
<el-tab-pane
|
||||
v-if="engineMode === 'cluster'"
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('system_parameter_setting.engine_mode_setting')"
|
||||
name="seven"
|
||||
/>
|
||||
|
||||
<el-tab-pane
|
||||
v-if="engineMode === 'cluster'"
|
||||
:lazy="true"
|
||||
lazy
|
||||
:label="$t('system_parameter_setting.kettle_setting')"
|
||||
name="eight"
|
||||
/>
|
||||
@ -95,8 +95,6 @@ export default {
|
||||
engineMode: 'local'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
beforeCreate() {
|
||||
pluginLoaded().then((res) => {
|
||||
this.isPluginLoaded = res.success && res.data
|
||||
@ -104,10 +102,6 @@ export default {
|
||||
engineMode().then((res) => {
|
||||
this.engineMode = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handlerBtn(btn) {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -333,36 +333,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const columnOptions = [
|
||||
{
|
||||
label: 'dataset.task_name',
|
||||
props: 'name'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.dataset',
|
||||
props: 'datasetName'
|
||||
},
|
||||
{
|
||||
label: 'dataset.execute_rate',
|
||||
props: 'rate'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.last_exec_time',
|
||||
props: 'lastExecTime'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.last_exec_status',
|
||||
props: 'lastExecStatus'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.next_exec_time',
|
||||
props: 'nextExecTime'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.task_status',
|
||||
props: 'status'
|
||||
}
|
||||
]
|
||||
import { columnOptions } from './options'
|
||||
import { formatOrders } from '@/utils/index'
|
||||
import { datasetTaskList, post } from '@/api/dataset/dataset'
|
||||
import { hasDataPermission } from '@/utils/permission'
|
||||
|
||||
@ -502,9 +502,10 @@ export default {
|
||||
},
|
||||
insertParamToCodeMirror(param) {
|
||||
const pos1 = this.$refs.myCm.codemirror.getCursor()
|
||||
const pos2 = {}
|
||||
pos2.line = pos1.line
|
||||
pos2.ch = pos1.ch
|
||||
const pos2 = {
|
||||
line: pos1.line,
|
||||
ch: pos1.ch
|
||||
}
|
||||
this.$refs.myCm.codemirror.replaceRange(param, pos2)
|
||||
},
|
||||
saveTask(task) {
|
||||
@ -542,14 +543,14 @@ export default {
|
||||
this.incrementalConfig = response.data
|
||||
|
||||
if (
|
||||
this.incrementalConfig.incrementalAdd.length === 0 &&
|
||||
this.incrementalConfig.incrementalDelete.length === 0
|
||||
!this.incrementalConfig.incrementalAdd.length &&
|
||||
!this.incrementalConfig.incrementalDelete.length
|
||||
) {
|
||||
this.incrementalUpdateType = 'incrementalAdd'
|
||||
this.sql = ''
|
||||
return
|
||||
}
|
||||
if (this.incrementalConfig.incrementalAdd.length > 0) {
|
||||
if (this.incrementalConfig.incrementalAdd.length) {
|
||||
this.incrementalUpdateType = 'incrementalAdd'
|
||||
this.sql = this.incrementalConfig.incrementalAdd
|
||||
} else {
|
||||
@ -561,29 +562,13 @@ export default {
|
||||
},
|
||||
incrementalUpdateTypeChange: function() {
|
||||
if (this.incrementalUpdateType === 'incrementalAdd') {
|
||||
if (this.sql) {
|
||||
this.incrementalConfig.incrementalDelete = this.sql
|
||||
} else {
|
||||
this.incrementalConfig.incrementalDelete = ''
|
||||
}
|
||||
if (this.incrementalConfig.incrementalAdd) {
|
||||
this.sql = this.incrementalConfig.incrementalAdd
|
||||
} else {
|
||||
this.sql = ''
|
||||
}
|
||||
this.incrementalConfig.incrementalDelete = this.sql || ''
|
||||
this.sql = this.incrementalConfig.incrementalAdd || ''
|
||||
}
|
||||
|
||||
if (this.incrementalUpdateType === 'incrementalDelete') {
|
||||
if (this.sql) {
|
||||
this.incrementalConfig.incrementalAdd = this.sql
|
||||
} else {
|
||||
this.incrementalConfig.incrementalAdd = ''
|
||||
}
|
||||
if (this.incrementalConfig.incrementalDelete) {
|
||||
this.sql = this.incrementalConfig.incrementalDelete
|
||||
} else {
|
||||
this.sql = ''
|
||||
}
|
||||
this.incrementalConfig.incrementalAdd = this.sql || ''
|
||||
this.sql = this.incrementalConfig.incrementalDelete || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,16 +5,8 @@
|
||||
<script>
|
||||
|
||||
export default ({
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('app/toggleSideBarHide', false)
|
||||
},
|
||||
method: {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -14,6 +14,38 @@ const filterDatasetRecord = {
|
||||
value: 'Error'
|
||||
}]
|
||||
}
|
||||
|
||||
const columnOptions = [
|
||||
{
|
||||
label: 'dataset.task_name',
|
||||
props: 'name'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.dataset',
|
||||
props: 'datasetName'
|
||||
},
|
||||
{
|
||||
label: 'dataset.execute_rate',
|
||||
props: 'rate'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.last_exec_time',
|
||||
props: 'lastExecTime'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.last_exec_status',
|
||||
props: 'lastExecStatus'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.next_exec_time',
|
||||
props: 'nextExecTime'
|
||||
},
|
||||
{
|
||||
label: 'dataset.task.task_status',
|
||||
props: 'status'
|
||||
}
|
||||
]
|
||||
|
||||
const filterDataset = [{
|
||||
name: 'dataset.execute_rate',
|
||||
type: 'dataset_table_task.rate',
|
||||
@ -75,5 +107,6 @@ function dateFormat(fmt, date) {
|
||||
export {
|
||||
filterDataset,
|
||||
dateFormat,
|
||||
filterDatasetRecord
|
||||
filterDatasetRecord,
|
||||
columnOptions
|
||||
}
|
||||
|
||||
@ -289,7 +289,6 @@ export default {
|
||||
const results = res.data.map(node => {
|
||||
if (node.hasChildren && !node.children) {
|
||||
node.children = null
|
||||
// delete node.children
|
||||
}
|
||||
return node
|
||||
})
|
||||
|
||||
@ -100,6 +100,9 @@ module.exports = {
|
||||
sass: {
|
||||
prependData: `@import "@/style/index.scss"`
|
||||
}
|
||||
},
|
||||
extract: {
|
||||
ignoreOrder: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user