forked from github/dataease
Merge branch 'dev' into pr@dev@feat_report_task_editor
This commit is contained in:
commit
2990887854
@ -125,12 +125,11 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<List<String>> data) {
|
||||
public void setData(List<List<String>> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 遍历excel下所有的sheet
|
||||
*
|
||||
@ -212,8 +211,8 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
thisColumn = frec.getColumn();
|
||||
thisStr = String.valueOf(frec.getValue());
|
||||
String fieldType = checkType(thisStr, thisColumn);
|
||||
if(fieldType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
|
||||
thisStr = thisStr.substring(0, thisStr.length() -2);
|
||||
if (fieldType != null && fieldType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")) {
|
||||
thisStr = thisStr.substring(0, thisStr.length() - 2);
|
||||
}
|
||||
cellList.add(thisColumn, thisStr);
|
||||
checkRowIsNull(thisStr); //如果里面某个单元格含有值,则标识该行不为空行
|
||||
@ -268,9 +267,9 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
value = value.equals("") ? "" : value;
|
||||
//向容器加入列值
|
||||
cellList.add(thisColumn, value);
|
||||
if(formatIndex == 59 || formatIndex== 14){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType("DATETIME");
|
||||
}else {
|
||||
if (formatIndex == 59 || formatIndex == 14) {
|
||||
totalSheets.get(totalSheets.size() - 1).getFields().get(thisColumn).setFieldType("DATETIME");
|
||||
} else {
|
||||
checkType(value, thisColumn);
|
||||
}
|
||||
checkRowIsNull(value); //如果里面某个单元格含有值,则标识该行不为空行
|
||||
@ -308,7 +307,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
}
|
||||
lastColumnNumber = -1;
|
||||
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
|
||||
if (!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)) {
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
excelSheetData.setData(new ArrayList<>());
|
||||
@ -316,7 +315,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
totalSheets.add(excelSheetData);
|
||||
}
|
||||
|
||||
if(curRow == 0){
|
||||
if (curRow == 0) {
|
||||
for (String s : cellList) {
|
||||
TableField tableField = new TableField();
|
||||
tableField.setFieldType("TEXT");
|
||||
@ -324,13 +323,13 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
tableField.setFieldName(s);
|
||||
tableField.setRemarks(s);
|
||||
this.fields.add(tableField);
|
||||
totalSheets.get(totalSheets.size() -1).getFields().add(tableField);
|
||||
totalSheets.get(totalSheets.size() - 1).getFields().add(tableField);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (flag && curRow != 0) { //该行不为空行且该行不是第一行,发送(第一行为列名,不需要)
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
|
||||
if (!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)) {
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setData(new ArrayList<>(data));
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
@ -339,13 +338,13 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
excelSheetData.getData().add(tmp);
|
||||
totalRows++;
|
||||
totalSheets.add(excelSheetData);
|
||||
}else {
|
||||
} else {
|
||||
List<String> tmp = new ArrayList<>(cellList);
|
||||
if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){
|
||||
totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
if (obtainedNum != null && totalSheets.stream().filter(s -> s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum) {
|
||||
totalSheets.stream().filter(s -> s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
}
|
||||
if(obtainedNum == null){
|
||||
totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
if (obtainedNum == null) {
|
||||
totalSheets.stream().filter(s -> s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
}
|
||||
totalRows++;
|
||||
}
|
||||
@ -369,7 +368,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
}
|
||||
|
||||
|
||||
private String checkType(String str, int thisColumn){
|
||||
private String checkType(String str, int thisColumn) {
|
||||
String type = null;
|
||||
try {
|
||||
double d = Double.valueOf(str);
|
||||
@ -382,22 +381,20 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
type = "DOUBLE";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
type = "TEXT";
|
||||
}
|
||||
}catch (Exception e){
|
||||
type = "TEXT";
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
if(curRow==1){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
if (curRow == 1) {
|
||||
totalSheets.get(totalSheets.size() - 1).getFields().get(thisColumn).setFieldType(type == null ? "TEXT" : type);
|
||||
}
|
||||
if(curRow > 1) {
|
||||
String oldType = totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).getFieldType();
|
||||
if(type.equalsIgnoreCase("TEXT")){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
if (curRow > 1 && type != null) {
|
||||
String oldType = totalSheets.get(totalSheets.size() - 1).getFields().get(thisColumn).getFieldType();
|
||||
if (type.equalsIgnoreCase("TEXT")) {
|
||||
totalSheets.get(totalSheets.size() - 1).getFields().get(thisColumn).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE") && oldType.equalsIgnoreCase("LONG")){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
if (type.equalsIgnoreCase("DOUBLE") && oldType.equalsIgnoreCase("LONG")) {
|
||||
totalSheets.get(totalSheets.size() - 1).getFields().get(thisColumn).setFieldType(type);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
|
@ -1,4 +1,5 @@
|
||||
package io.dataease.commons.utils;
|
||||
|
||||
import io.dataease.dto.dataset.ExcelSheetData;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.dto.datasource.TableField;
|
||||
@ -35,7 +36,8 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
/**
|
||||
* 自定义获取表格某些信
|
||||
*/
|
||||
public Map map = new TreeMap<String,String>();
|
||||
public Map map = new TreeMap<String, String>();
|
||||
|
||||
/**
|
||||
* 单元格中的数据可能的数据类型
|
||||
*/
|
||||
@ -56,7 +58,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
/**
|
||||
* 总行数
|
||||
*/
|
||||
private int totalRows=0;
|
||||
private int totalRows = 0;
|
||||
|
||||
/**
|
||||
* 一行内cell集合
|
||||
@ -101,7 +103,6 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
private String formatString;
|
||||
|
||||
|
||||
|
||||
//定义前一个元素和当前元素的位置,用来计算其中空的单元格数量,如A6和A8等
|
||||
private String preRef = null, ref = null;
|
||||
|
||||
@ -143,7 +144,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<List<String>> data) {
|
||||
public void setData(List<List<String>> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@ -190,11 +191,11 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
*/
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
|
||||
if(this.obtainedNum !=null && curRow>this.obtainedNum){
|
||||
if (this.obtainedNum != null && curRow > this.obtainedNum) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(name.equalsIgnoreCase("mergeCell")){
|
||||
if (name.equalsIgnoreCase("mergeCell")) {
|
||||
throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
|
||||
}
|
||||
//c => 单元格
|
||||
@ -221,6 +222,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
* 得到单元格对应的索引值或是内容值
|
||||
* 如果单元格类型是字符串、INLINESTR、数字、日期,lastIndex则是索引值
|
||||
* 如果单元格类型是布尔值、错误、公式,lastIndex则是内容值
|
||||
*
|
||||
* @param ch
|
||||
* @param start
|
||||
* @param length
|
||||
@ -228,7 +230,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
*/
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
if(this.obtainedNum !=null && curRow>this.obtainedNum){
|
||||
if (this.obtainedNum != null && curRow > this.obtainedNum) {
|
||||
return;
|
||||
}
|
||||
lastIndex += new String(ch, start, length);
|
||||
@ -244,14 +246,14 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
*/
|
||||
@Override
|
||||
public void endElement(String uri, String localName, String name) throws SAXException {
|
||||
if(this.obtainedNum !=null && curRow>this.obtainedNum){
|
||||
if (this.obtainedNum != null && curRow > this.obtainedNum) {
|
||||
return;
|
||||
}
|
||||
//t元素也包含字符串
|
||||
if (isTElement) { //这个程序没经过
|
||||
//将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符
|
||||
String value = lastIndex.trim();
|
||||
if(curRow==1){
|
||||
if (curRow == 1) {
|
||||
TableField tableField = new TableField();
|
||||
tableField.setFieldType("TEXT");
|
||||
tableField.setFieldSize(65533);
|
||||
@ -271,21 +273,21 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
String value = this.getDataValue(lastIndex.trim(), "");//根据索引值获取对应的单元格值
|
||||
if (preRef == null) {
|
||||
preRef = "A" + curRow;
|
||||
if(!preRef.equalsIgnoreCase(ref)){
|
||||
if (!preRef.equalsIgnoreCase(ref)) {
|
||||
cellList.add(curCol, "");
|
||||
curCol++;
|
||||
}
|
||||
}
|
||||
|
||||
//补全单元格之间的空单元格
|
||||
if (!"A".equals(preRef.substring(0, 1)) && curRow==1 && preRef.equalsIgnoreCase(ref)) {
|
||||
if (!"A".equals(preRef.substring(0, 1)) && curRow == 1 && preRef.equalsIgnoreCase(ref)) {
|
||||
throw new RuntimeException(Translator.get("i18n_excel_empty_column"));
|
||||
}else if (!ref.equals(preRef)) {
|
||||
} else if (!ref.equals(preRef)) {
|
||||
int len = countNullCell(ref, preRef);
|
||||
for (int i = 0; i < len; i++) {
|
||||
if(curCol < this.fields.size()){
|
||||
if (curCol < this.fields.size()) {
|
||||
cellList.add(curCol, "");
|
||||
if(curRow==1){
|
||||
if (curRow == 1) {
|
||||
addField("", curCol);
|
||||
}
|
||||
curCol++;
|
||||
@ -293,7 +295,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if(curCol < this.fields.size()){
|
||||
if (curCol < this.fields.size()) {
|
||||
cellList.add(curCol, value);
|
||||
}
|
||||
curCol++;
|
||||
@ -309,8 +311,8 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
if (curRow == 1) {
|
||||
maxRef = ref;
|
||||
}
|
||||
if(curRow>1){
|
||||
for (int i=cellList.size();i<this.fields.size();i++){
|
||||
if (curRow > 1) {
|
||||
for (int i = cellList.size(); i < this.fields.size(); i++) {
|
||||
cellList.add("");
|
||||
}
|
||||
List<String> tmp = new ArrayList<>(cellList);
|
||||
@ -322,7 +324,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
curCol = 0;
|
||||
preRef = null;
|
||||
ref = null;
|
||||
flag=false;
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -357,9 +359,8 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
formatIndex = style.getDataFormat();
|
||||
formatString = style.getDataFormatString();
|
||||
short format = this.formatIndex;
|
||||
if ( (14 <= format && format <= 17) || format == 20 || format == 22 || format == 31 || format == 35 || format == 45 || format == 46 || format == 47 || (57 <= format && format <= 59)
|
||||
|| (175 < format && format < 178) || (182 <= format && format <= 196) || (210 <= format && format <= 213) || (208 == format))
|
||||
{ // 日期
|
||||
if ((14 <= format && format <= 17) || format == 20 || format == 22 || format == 31 || format == 35 || format == 45 || format == 46 || format == 47 || (57 <= format && format <= 59)
|
||||
|| (175 < format && format < 178) || (182 <= format && format <= 196) || (210 <= format && format <= 213) || (208 == format)) { // 日期
|
||||
isDateFormat = true;
|
||||
}
|
||||
|
||||
@ -369,6 +370,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
|
||||
/**
|
||||
* 对解析出来的数据进行类型处理
|
||||
*
|
||||
* @param value 单元格的值,
|
||||
* value代表解析:BOOL的为0或1, ERROR的为内容值,FORMULA的为内容值,INLINESTR的为索引值需转换为内容值,
|
||||
* SSTINDEX的为索引值需转换为内容值, NUMBER为内容值,DATE为内容值
|
||||
@ -377,7 +379,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public String getDataValue(String value, String thisStr) {
|
||||
String type = "TEXT";
|
||||
String type = null;
|
||||
switch (nextDataType) {
|
||||
// 这几个的顺序不能随便交换,交换了很可能会导致数据错误
|
||||
case BOOL: //布尔值
|
||||
@ -401,11 +403,11 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
String sstIndex = value.toString();
|
||||
try {
|
||||
int idx = Integer.parseInt(sstIndex);
|
||||
if(sst != null){
|
||||
if (sst != null) {
|
||||
XSSFRichTextString rtss = new XSSFRichTextString(sst.getEntryAt(idx));//根据idx索引值获取内容值
|
||||
thisStr = rtss.toString();
|
||||
rtss = null;
|
||||
}else {
|
||||
} else {
|
||||
thisStr = value.toString();
|
||||
}
|
||||
|
||||
@ -422,12 +424,13 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
}
|
||||
thisStr = thisStr.replace("_", "").trim();
|
||||
|
||||
if(isDateFormat ){
|
||||
type = "DATETIME";isDateFormat = false;
|
||||
if(formatString != null && formatString.contains("%")){
|
||||
if (isDateFormat) {
|
||||
type = "DATETIME";
|
||||
isDateFormat = false;
|
||||
if (formatString != null && formatString.contains("%")) {
|
||||
type = getType(thisStr);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
type = getType(thisStr);
|
||||
}
|
||||
break;
|
||||
@ -441,60 +444,67 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
thisStr = " ";
|
||||
break;
|
||||
}
|
||||
if(curRow==1){
|
||||
if (curRow == 1) {
|
||||
addField(thisStr, null);
|
||||
}else {
|
||||
if(CollectionUtils.isEmpty(this.getFields())){
|
||||
} else {
|
||||
if (CollectionUtils.isEmpty(this.getFields())) {
|
||||
throw new RuntimeException(Translator.get("i18n_excel_header_empty"));
|
||||
}
|
||||
if(curCol >= this.fields.size()){
|
||||
if (curCol >= this.fields.size()) {
|
||||
return thisStr;
|
||||
}
|
||||
if(curRow==2){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}else {
|
||||
if(type.equalsIgnoreCase("TEXT")){
|
||||
if (curRow == 2) {
|
||||
if (type != null) {
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE") && this.getFields().get(curCol).getFieldType().equalsIgnoreCase("LONG")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DATETIME")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
} else {
|
||||
if (type != null) {
|
||||
if (type.equalsIgnoreCase("TEXT")) {
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if (type.equalsIgnoreCase("DOUBLE") && this.getFields().get(curCol).getFieldType().equalsIgnoreCase("LONG")) {
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if (type.equalsIgnoreCase("DATETIME")) {
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return thisStr;
|
||||
}
|
||||
|
||||
private void addField(String columeName, Integer index){
|
||||
private void addField(String columeName, Integer index) {
|
||||
TableField tableField = new TableField();
|
||||
tableField.setFieldType("TEXT");
|
||||
tableField.setFieldSize(65533);
|
||||
tableField.setFieldName(columeName);
|
||||
tableField.setRemarks(columeName);
|
||||
if(index != null){
|
||||
if (index != null) {
|
||||
this.fields.add(index, tableField);
|
||||
}else {
|
||||
} else {
|
||||
this.fields.add(tableField);
|
||||
}
|
||||
}
|
||||
private String getType(String thisStr){
|
||||
if(totalRows==0){
|
||||
|
||||
private String getType(String thisStr) {
|
||||
if (totalRows == 0) {
|
||||
return "TEXT";
|
||||
}
|
||||
try{
|
||||
if(thisStr.endsWith("%")){
|
||||
thisStr = thisStr.substring(0, thisStr.length()-1);
|
||||
thisStr = String.valueOf(Double.valueOf(thisStr)/100);
|
||||
|
||||
try {
|
||||
if (thisStr.endsWith("%")) {
|
||||
thisStr = thisStr.substring(0, thisStr.length() - 1);
|
||||
thisStr = String.valueOf(Double.valueOf(thisStr) / 100);
|
||||
}
|
||||
Long.valueOf(thisStr);
|
||||
return "LONG";
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
Double.valueOf(thisStr);
|
||||
return "DOUBLE";
|
||||
}catch (Exception ignore){ }
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
return "TEXT";
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.controller.request.dataset.MultFieldValuesRequest;
|
||||
import io.dataease.controller.response.DatasetTableField4Type;
|
||||
import io.dataease.dto.dataset.DatasetTableFieldDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTable;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
@ -106,9 +107,33 @@ public class DataSetTableFieldController {
|
||||
DatasetTableField datasetTableField = DatasetTableField.builder().build();
|
||||
datasetTableField.setTableId(tableId);
|
||||
datasetTableField.setGroupType("d");
|
||||
List<DatasetTableField> dimensionList = dataSetTableFieldsService.list(datasetTableField);
|
||||
List<DatasetTableFieldDTO> dimensionList = new ArrayList<>();
|
||||
dataSetTableFieldsService.list(datasetTableField).forEach(o -> {
|
||||
DatasetTableFieldDTO datasetTableFieldDTO = new DatasetTableFieldDTO();
|
||||
BeanUtils.copyProperties(o, datasetTableFieldDTO);
|
||||
List<Object> deTypeCascader = new ArrayList<>();
|
||||
deTypeCascader.add(datasetTableFieldDTO.getDeType());
|
||||
if (datasetTableFieldDTO.getDeExtractType() == 0 && datasetTableFieldDTO.getDeType() == 1) {
|
||||
deTypeCascader.add(datasetTableFieldDTO.getDateFormatType());
|
||||
}
|
||||
datasetTableFieldDTO.setDeTypeCascader(deTypeCascader);
|
||||
dimensionList.add(datasetTableFieldDTO);
|
||||
});
|
||||
|
||||
|
||||
datasetTableField.setGroupType("q");
|
||||
List<DatasetTableField> quotaList = dataSetTableFieldsService.list(datasetTableField);
|
||||
List<DatasetTableFieldDTO> quotaList = new ArrayList<>();
|
||||
dataSetTableFieldsService.list(datasetTableField).forEach(o -> {
|
||||
DatasetTableFieldDTO datasetTableFieldDTO = new DatasetTableFieldDTO();
|
||||
BeanUtils.copyProperties(o, datasetTableFieldDTO);
|
||||
List<Object> deTypeCascader = new ArrayList<>();
|
||||
deTypeCascader.add(datasetTableFieldDTO.getDeType());
|
||||
if (datasetTableFieldDTO.getDeExtractType() == 0 && datasetTableFieldDTO.getDeType() == 1) {
|
||||
deTypeCascader.add(datasetTableFieldDTO.getDateFormatType());
|
||||
}
|
||||
datasetTableFieldDTO.setDeTypeCascader(deTypeCascader);
|
||||
quotaList.add(datasetTableFieldDTO);
|
||||
});
|
||||
|
||||
DatasetTableField4Type datasetTableField4Type = new DatasetTableField4Type();
|
||||
datasetTableField4Type.setDimensionList(dimensionList);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.dataease.controller.response;
|
||||
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.dto.dataset.DatasetTableFieldDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class DatasetTableField4Type {
|
||||
@ApiModelProperty("维度")
|
||||
List<DatasetTableField> dimensionList;
|
||||
List<DatasetTableFieldDTO> dimensionList;
|
||||
@ApiModelProperty("指标")
|
||||
List<DatasetTableField> quotaList;
|
||||
List<DatasetTableFieldDTO> quotaList;
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package io.dataease.dto.dataset;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DatasetTableFieldDTO extends DatasetTableField {
|
||||
private String jsonPath;
|
||||
private List<Object> deTypeCascader;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.ck;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
@ -17,6 +18,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
import io.dataease.plugins.datasource.query.Utils;
|
||||
@ -1400,4 +1402,15 @@ public class CKQueryProvider extends QueryProvider {
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"%Y%m%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y/%m/%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y-%m-%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y%m%d %H:%M:%S\"},\n" +
|
||||
"{\"dateformat\": \"%Y/%m/%d %H:%M:%S\"},\n" +
|
||||
"{\"dateformat\": \"%Y-%m-%d %H:%M:%S\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.db2;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.dto.datasource.Db2Configuration;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
@ -18,6 +19,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
@ -1378,4 +1380,15 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
schema = String.format(Db2Constants.KEYWORD_TABLE, schema);
|
||||
return "SELECT * FROM " + schema + "." + String.format(Db2Constants.KEYWORD_TABLE, table);
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD HH24:MI:SS\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.es;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
import io.dataease.plugins.datasource.query.Utils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -1311,4 +1313,15 @@ public class EsQueryProvider extends QueryProvider {
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"yyyy/MM/dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MMdd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyyMMdd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MMdd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd HH:mm:ss\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.hive;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
import io.dataease.plugins.datasource.query.Utils;
|
||||
@ -1299,4 +1301,15 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"yyyyMMdd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MM/dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MM/dd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyyMMdd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd HH:mm:ss\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.impala;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
import io.dataease.plugins.datasource.query.Utils;
|
||||
@ -1276,4 +1278,15 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MM/dd\"},\n" +
|
||||
"{\"dateformat\": \"yyyyMMdd\"},\n" +
|
||||
"{\"dateformat\": \"yyyy-MM-dd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyy/MMdd HH:mm:ss\"},\n" +
|
||||
"{\"dateformat\": \"yyyyMMdd HH:mm:ss\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.mongodb;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
import io.dataease.plugins.datasource.query.Utils;
|
||||
@ -1150,4 +1152,15 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"%Y-%m-%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y/%m/%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y%m%d\"},\n" +
|
||||
"{\"dateformat\": \"%Y-%m-%d %H:%i:%S\"},\n" +
|
||||
"{\"dateformat\": \"%Y/%m/%d %H:%i:%S\"},\n" +
|
||||
"{\"dateformat\": \"%Y%m%d %H:%i:%S\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.oracle;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.dto.datasource.OracleConfiguration;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
@ -18,6 +19,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
@ -1427,4 +1429,15 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
schema = String.format(OracleConstants.KEYWORD_TABLE, schema);
|
||||
return "SELECT * FROM " + schema + "." + String.format(OracleConstants.KEYWORD_TABLE, table);
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD HH24:MI:SS\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.pg;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
@ -18,6 +19,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
@ -1301,4 +1303,15 @@ public class PgQueryProvider extends QueryProvider {
|
||||
schema = String.format(PgConstants.KEYWORD_TABLE, schema);
|
||||
return "SELECT * FROM " + schema + "." + String.format(PgConstants.KEYWORD_TABLE, table);
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD HH24:MI:SS\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.redshift;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
@ -16,6 +17,7 @@ import io.dataease.plugins.common.dto.sqlObj.SQLObj;
|
||||
import io.dataease.plugins.common.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.plugins.common.request.permission.DataSetRowPermissionsTreeDTO;
|
||||
import io.dataease.plugins.common.request.permission.DatasetRowPermissionsTreeItem;
|
||||
import io.dataease.plugins.datasource.entity.Dateformat;
|
||||
import io.dataease.plugins.datasource.entity.JdbcConfiguration;
|
||||
import io.dataease.plugins.datasource.entity.PageInfo;
|
||||
import io.dataease.plugins.datasource.query.QueryProvider;
|
||||
@ -1286,4 +1288,15 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
schema = String.format(PgConstants.KEYWORD_TABLE, schema);
|
||||
return "SELECT * FROM " + schema + "." + String.format(PgConstants.KEYWORD_TABLE, table);
|
||||
}
|
||||
|
||||
public List<Dateformat> dateformat() {
|
||||
return JSONArray.parseArray("[\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD\"},\n" +
|
||||
"{\"dateformat\": \"YYYY-MM-DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYY/MM/DD HH24:MI:SS\"},\n" +
|
||||
"{\"dateformat\": \"YYYYMMDD HH24:MI:SS\"}\n" +
|
||||
"]", Dateformat.class);
|
||||
}
|
||||
}
|
||||
|
@ -335,6 +335,9 @@ public class DataSetTableTaskService {
|
||||
|
||||
public void execTask(DatasetTableTask datasetTableTask) throws Exception {
|
||||
execNow(datasetTableTask);
|
||||
if(datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())){
|
||||
scheduleService.addSchedule(datasetTableTask);
|
||||
}
|
||||
if (!datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) {
|
||||
scheduleService.fireNow(datasetTableTask);
|
||||
}
|
||||
|
@ -40,9 +40,8 @@ WHERE (`component` = 'msg/setting');
|
||||
ALTER TABLE `panel_group`
|
||||
ADD COLUMN `panel_sort` bigint(13) NULL COMMENT '排序' AFTER `watermark_open`;
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER TABLE `sys_task_email`
|
||||
CHANGE COLUMN `content` `content` MEDIUMBLOB NULL DEFAULT NULL COMMENT '内容' ;
|
||||
|
||||
ALTER TABLE `dataset_table_field`
|
||||
ADD COLUMN `date_format_type` VARCHAR(255) NULL COMMENT '时间格式类型' AFTER `date_format`;
|
||||
|
@ -35,7 +35,7 @@
|
||||
"@antv/l7-scene": "2.8.31",
|
||||
"@antv/l7-source": "2.8.31",
|
||||
"@antv/l7-utils": "2.8.31",
|
||||
"@antv/s2": "^1.11.0",
|
||||
"@antv/s2": "1.35.0",
|
||||
"@antv/util": "^2.0.17",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"@tinymce/tinymce-vue": "^3.2.8",
|
||||
|
@ -99,6 +99,30 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-tooltip
|
||||
v-if="attrShow('fontSize')"
|
||||
:content="$t('panel.active_font_size')"
|
||||
>
|
||||
<i
|
||||
style="float: left;margin-top: 3px;margin-left: 2px;"
|
||||
class="iconfont icon-font"
|
||||
/>
|
||||
</el-tooltip>
|
||||
|
||||
<div
|
||||
v-if="attrShow('activeFontSize')"
|
||||
style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;"
|
||||
>
|
||||
<el-input
|
||||
v-model="initActiveFontSize"
|
||||
type="number"
|
||||
size="mini"
|
||||
:min="miniFontSize"
|
||||
:max="maxFontSize"
|
||||
@change="styleChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-tooltip
|
||||
v-if="attrShow('fontWeight')"
|
||||
:content="$t('panel.fontWeight')"
|
||||
@ -440,6 +464,7 @@ export default {
|
||||
innerOpacity: 0,
|
||||
mainWidthOffset: 600,
|
||||
initFontSize: 12,
|
||||
initActiveFontSize: 18,
|
||||
miniFontSize: 0,
|
||||
maxFontSize: 128,
|
||||
textAlignOptions: [
|
||||
@ -520,6 +545,7 @@ export default {
|
||||
// tab组件显示的属性
|
||||
'de-tabs': [
|
||||
'fontSize',
|
||||
'activeFontSize',
|
||||
'borderStyle',
|
||||
'borderWidth',
|
||||
'borderColor',
|
||||
@ -623,6 +649,7 @@ export default {
|
||||
handler(newVal, oldVla) {
|
||||
if (newVal.fontSize) {
|
||||
this.initFontSize = newVal.fontSize
|
||||
this.initActiveFontSize = newVal.activeFontSize
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
@ -632,6 +659,17 @@ export default {
|
||||
this.styleInfo['opacity'] = this.innerOpacity / 100
|
||||
}
|
||||
},
|
||||
initActiveFontSize: {
|
||||
handler(newVal) {
|
||||
if (newVal < this.miniFontSize) {
|
||||
this.styleInfo.activeFontSize = this.miniFontSize
|
||||
} else if (newVal > this.maxFontSize) {
|
||||
this.styleInfo.activeFontSize = this.maxFontSize
|
||||
} else {
|
||||
this.styleInfo.activeFontSize = newVal
|
||||
}
|
||||
}
|
||||
},
|
||||
initFontSize: {
|
||||
handler(newVal) {
|
||||
if (newVal < this.miniFontSize) {
|
||||
@ -656,6 +694,9 @@ export default {
|
||||
if (this.attrShow('fontSize')) {
|
||||
this.initFontSize = this.styleInfo.fontSize
|
||||
}
|
||||
if (this.attrShow('activeFontSize')) {
|
||||
this.initActiveFontSize = this.styleInfo.activeFontSize
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -208,6 +208,7 @@ export default {
|
||||
'left',
|
||||
'width',
|
||||
'fontSize',
|
||||
'activeFontSize',
|
||||
'borderWidth',
|
||||
'letterSpacing'
|
||||
],
|
||||
|
@ -94,8 +94,7 @@ export const VIDEOLINKS = {
|
||||
fullscreenToggle: false,
|
||||
pause: false
|
||||
},
|
||||
sources: [{
|
||||
}]
|
||||
sources: [{}]
|
||||
},
|
||||
rtmp: {
|
||||
sources: [{
|
||||
@ -389,7 +388,10 @@ const list = [
|
||||
borderStyle: 'solid',
|
||||
borderWidth: 0,
|
||||
borderColor: '#000000',
|
||||
fontSize: 16
|
||||
fontSize: 16,
|
||||
activeFontSize: 18,
|
||||
carouselEnable: false,
|
||||
switchTime: 5
|
||||
},
|
||||
options: {
|
||||
tabList: [{
|
||||
|
@ -103,6 +103,9 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
|
||||
}
|
||||
if (item.type === 'de-tabs') {
|
||||
item.style.fontSize = item.style.fontSize || 16
|
||||
item.style.activeFontSize = item.style.activeFontSize || 18
|
||||
item.style.carouselEnable = item.style.carouselEnable || false
|
||||
item.style.switchTime = item.style.switchTime || 5
|
||||
}
|
||||
if (item.type === 'custom') {
|
||||
item.options.manualModify = false
|
||||
|
@ -29,7 +29,7 @@
|
||||
:name="item.name"
|
||||
>
|
||||
<span slot="label">
|
||||
<span :style="titleStyle">{{ item.title }}</span>
|
||||
<span :style="titleStyle(item.name)">{{ item.title }}</span>
|
||||
<el-dropdown
|
||||
v-if="dropdownShow"
|
||||
slot="label"
|
||||
@ -272,6 +272,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timer: null,
|
||||
scrollLeft: 50,
|
||||
scrollTop: 10,
|
||||
// 需要展示属性设置的组件类型
|
||||
@ -304,11 +305,6 @@ export default {
|
||||
maskShow() {
|
||||
return Boolean(this.$store.state.dragComponentInfo)
|
||||
},
|
||||
titleStyle() {
|
||||
return {
|
||||
fontSize: (this.element.style.fontSize || 16) + 'px'
|
||||
}
|
||||
},
|
||||
headClass() {
|
||||
return 'tab-head-' + this.element.style.headPosition
|
||||
},
|
||||
@ -393,6 +389,16 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'element.style.carouselEnable': {
|
||||
handler(newVal, oldVla) {
|
||||
this.initCarousel()
|
||||
}
|
||||
},
|
||||
'element.style.switchTime': {
|
||||
handler(newVal, oldVla) {
|
||||
this.initCarousel()
|
||||
}
|
||||
},
|
||||
activeTabName: {
|
||||
handler(newVal, oldVla) {
|
||||
this.$store.commit('setTabActiveTabNameMap', { tabId: this.element.id, activeTabName: this.activeTabName })
|
||||
@ -439,10 +445,37 @@ export default {
|
||||
this.$store.commit('setTabActiveTabNameMap', { tabId: this.element.id, activeTabName: this.activeTabName })
|
||||
this.setContentThemeStyle()
|
||||
},
|
||||
mounted() {
|
||||
this.initCarousel()
|
||||
},
|
||||
beforeDestroy() {
|
||||
bus.$off('add-new-tab', this.addNewTab)
|
||||
},
|
||||
methods: {
|
||||
titleStyle(itemName) {
|
||||
if (this.activeTabName === itemName) {
|
||||
return {
|
||||
fontSize: (this.element.style.activeFontSize || 18) + 'px'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
fontSize: (this.element.style.fontSize || 16) + 'px'
|
||||
}
|
||||
}
|
||||
},
|
||||
initCarousel() {
|
||||
this.timer && clearInterval(this.timer)
|
||||
if (this.element.style.carouselEnable) {
|
||||
const switchTime = (this.element.style.switchTime || 5) * 1000
|
||||
let switchCount = 1
|
||||
// 轮播定时器
|
||||
this.timer = setInterval(() => {
|
||||
switchCount++
|
||||
const nowIndex = switchCount % this.element.options.tabList.length
|
||||
this.activeTabName = this.element.options.tabList[nowIndex].name
|
||||
}, switchTime)
|
||||
}
|
||||
},
|
||||
initScroll() {
|
||||
this.scrollLeft = 50
|
||||
this.scrollTop = 10
|
||||
|
@ -112,6 +112,38 @@
|
||||
<el-radio-button label="right">{{ $t('chart.text_pos_right') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('panel.carousel')">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-checkbox
|
||||
v-model="styleInfo.carouselEnable"
|
||||
size="mini"
|
||||
@change="styleChange"
|
||||
>{{ $t('commons.enable') }}
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="8"
|
||||
style="text-align: right;padding-right: 10px"
|
||||
>
|
||||
{{ $t('panel.switch_time') }}
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-input
|
||||
v-model="styleInfo.switchTime"
|
||||
:disabled="!styleInfo.carouselEnable"
|
||||
type="number"
|
||||
size="mini"
|
||||
:min="2"
|
||||
class="hide-icon-number"
|
||||
@change="styleChange"
|
||||
>
|
||||
<template slot="append">S</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<i
|
||||
slot="reference"
|
||||
|
@ -915,9 +915,11 @@ export default {
|
||||
password_input_error: 'Original password input error'
|
||||
},
|
||||
chart: {
|
||||
gradient: 'Gradient',
|
||||
layer_controller: 'Quota switch',
|
||||
suspension: 'Suspension',
|
||||
chart_background: 'Component background',
|
||||
date_format: 'Select date resolution format',
|
||||
solid_color: 'Solid color',
|
||||
split_gradient: 'Split gradient',
|
||||
continuous_gradient: 'Continuous gradient',
|
||||
@ -1875,10 +1877,13 @@ export default {
|
||||
back_parent: 'Back to previous'
|
||||
},
|
||||
panel: {
|
||||
active_font_size: 'Active font size',
|
||||
carousel: 'Carousel',
|
||||
switch_time: 'Switch time',
|
||||
position_adjust: 'Position',
|
||||
space_top: 'Top',
|
||||
space_left: 'Left',
|
||||
space_width: 'Widht',
|
||||
space_width: 'Width',
|
||||
space_height: 'Height',
|
||||
to_top: 'To Top',
|
||||
down: 'Down',
|
||||
|
@ -915,9 +915,11 @@ export default {
|
||||
password_input_error: '原始密碼輸入錯誤'
|
||||
},
|
||||
chart: {
|
||||
gradient: '漸變',
|
||||
layer_controller: '指標切換',
|
||||
suspension: '懸浮',
|
||||
chart_background: '組件背景',
|
||||
date_format: '選擇日期解析格式',
|
||||
solid_color: '純色',
|
||||
split_gradient: '分離漸變',
|
||||
continuous_gradient: '連續漸變',
|
||||
@ -1875,6 +1877,9 @@ export default {
|
||||
back_parent: '返回上一級'
|
||||
},
|
||||
panel: {
|
||||
active_font_size: '激活字體大小',
|
||||
carousel: '輪播',
|
||||
switch_time: '切換時間',
|
||||
position_adjust: '位置',
|
||||
space_top: '上',
|
||||
space_left: '左',
|
||||
|
@ -914,9 +914,11 @@ export default {
|
||||
password_input_error: '原始密码输入错误'
|
||||
},
|
||||
chart: {
|
||||
gradient: '渐变',
|
||||
layer_controller: '指标切换',
|
||||
suspension: '悬浮',
|
||||
chart_background: '组件背景',
|
||||
date_format: '请选择日期解析格式',
|
||||
solid_color: '纯色',
|
||||
split_gradient: '分离渐变',
|
||||
continuous_gradient: '连续渐变',
|
||||
@ -1875,6 +1877,9 @@ export default {
|
||||
back_parent: '返回上一级'
|
||||
},
|
||||
panel: {
|
||||
active_font_size: '激活字体大小',
|
||||
carousel: '轮播',
|
||||
switch_time: '切换时间',
|
||||
position_adjust: '位置',
|
||||
space_top: '上',
|
||||
space_left: '左',
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 2459092 */
|
||||
src: url('iconfont.woff2?t=1668397590143') format('woff2'),
|
||||
url('iconfont.woff?t=1668397590143') format('woff'),
|
||||
url('iconfont.ttf?t=1668397590143') format('truetype');
|
||||
src: url('iconfont.woff2?t=1669087400468') format('woff2'),
|
||||
url('iconfont.woff?t=1669087400468') format('woff'),
|
||||
url('iconfont.ttf?t=1669087400468') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@ -13,6 +13,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-font:before {
|
||||
content: "\e63d";
|
||||
}
|
||||
|
||||
.icon-WATERMARK:before {
|
||||
content: "\ea16";
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,6 +5,13 @@
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "109745",
|
||||
"name": "font",
|
||||
"font_class": "font",
|
||||
"unicode": "e63d",
|
||||
"unicode_decimal": 58941
|
||||
},
|
||||
{
|
||||
"icon_id": "23072499",
|
||||
"name": "WATERMARK",
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -103,6 +103,11 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
|
||||
options.isPercent = chart.type === 'percentage-bar-stack'
|
||||
// custom color
|
||||
options.color = antVCustomColor(chart)
|
||||
if (customAttr.color.gradient) {
|
||||
options.color = options.color.map((ele) => {
|
||||
return `l(270) 0:#ffffff00 1:${ele}`
|
||||
})
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
@ -199,6 +204,11 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
||||
}
|
||||
// custom color
|
||||
options.color = antVCustomColor(chart)
|
||||
if (customAttr.color.gradient) {
|
||||
options.color = options.color.map((ele) => {
|
||||
return `l(0) 0:#ffffff00 1:${ele}`
|
||||
})
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
|
@ -28,6 +28,7 @@ export const DEFAULT_COLOR_CASE = {
|
||||
tableBorderColor: '#E6E7E4',
|
||||
seriesColors: [], // 格式:{"name":"s1","color":"","isCustom":false}
|
||||
areaBorderColor: '#303133',
|
||||
gradient: false,
|
||||
areaBaseColor: '#FFFFFF'
|
||||
}
|
||||
|
||||
|
@ -124,6 +124,7 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasThreshold) {
|
||||
options.range = {
|
||||
color: theme.styleSheet.paletteQualitative10,
|
||||
@ -152,6 +153,17 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
|
||||
}
|
||||
}
|
||||
|
||||
if (customAttr.color.gradient) {
|
||||
const colorList = (theme.styleSheet?.paletteQualitative10 || []).map((ele) => `l(0) 0:#ffffff00 1:${ele}`)
|
||||
if (!options.range) {
|
||||
options.range = {
|
||||
color: colorList
|
||||
}
|
||||
} else {
|
||||
options.range.color = colorList
|
||||
}
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
plot.destroy()
|
||||
|
@ -180,6 +180,17 @@ export function baseAreaOptionAntV(plot, container, chart, action, isStack) {
|
||||
}
|
||||
// custom color
|
||||
options.color = antVCustomColor(chart)
|
||||
const areaColors = [...options.color, ...options.color]
|
||||
if (customAttr.color.gradient) {
|
||||
options.areaStyle = () => {
|
||||
const cr = areaColors.shift()
|
||||
if (cr) {
|
||||
return {
|
||||
fill: `l(270) 0:#ffffff00 1:${cr}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
|
@ -82,6 +82,12 @@ export function basePieOptionAntV(plot, container, chart, action) {
|
||||
// custom color
|
||||
options.color = antVCustomColor(chart)
|
||||
|
||||
if (customAttr.color.gradient) {
|
||||
options.color = options.color.map((ele) => {
|
||||
return `l(270) 0:#ffffff00 1:${ele}`
|
||||
})
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
plot.destroy()
|
||||
@ -159,6 +165,12 @@ export function basePieRoseOptionAntV(plot, container, chart, action) {
|
||||
// custom color
|
||||
options.color = antVCustomColor(chart)
|
||||
|
||||
if (customAttr.color.gradient) {
|
||||
options.color = options.color.map((ele) => {
|
||||
return `l(270) 0:#ffffff00 1:${ele}`
|
||||
})
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
if (plot) {
|
||||
plot.destroy()
|
||||
|
@ -424,7 +424,7 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
|
||||
|
||||
// 解析合计、小计排序
|
||||
const sortParams = []
|
||||
if (totalCfg.row.totalSort && totalCfg.row.totalSort !== 'none' && c.length > 0) {
|
||||
if (totalCfg.row.totalSort && totalCfg.row.totalSort !== 'none' && c.length > 0 && totalCfg.row.showGrandTotals && v.indexOf(totalCfg.row.totalSortField) > -1) {
|
||||
const sort = {
|
||||
sortFieldId: c[0],
|
||||
sortMethod: totalCfg.row.totalSort.toUpperCase(),
|
||||
@ -435,7 +435,8 @@ export function baseTablePivot(s2, container, chart, action, tableData) {
|
||||
}
|
||||
sortParams.push(sort)
|
||||
}
|
||||
if (totalCfg.col.totalSort && totalCfg.col.totalSort !== 'none' && r.length > 0) {
|
||||
totalCfg.col.totalSort = false
|
||||
if (totalCfg.col.totalSort && totalCfg.col.totalSort !== 'none' && r.length > 0 && totalCfg.col.showGrandTotals && v.indexOf(totalCfg.col.totalSortField) > -1) {
|
||||
const sort = {
|
||||
sortFieldId: r[0],
|
||||
sortMethod: totalCfg.col.totalSort.toUpperCase(),
|
||||
|
@ -280,6 +280,7 @@ export const TYPE_CONFIGS = [
|
||||
'color-selector': [
|
||||
'value',
|
||||
'custom',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -464,7 +465,8 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'alpha'
|
||||
'alpha',
|
||||
'gradient'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
'lineWidth',
|
||||
@ -624,6 +626,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -703,6 +706,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -782,6 +786,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -861,6 +866,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1004,6 +1010,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1083,6 +1090,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1160,6 +1168,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1219,6 +1228,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1279,6 +1289,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1336,6 +1347,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
@ -1396,6 +1408,7 @@ export const TYPE_CONFIGS = [
|
||||
'value',
|
||||
'colorPanel',
|
||||
'customColor',
|
||||
'gradient',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
|
@ -151,6 +151,17 @@
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-show="showProperty('gradient')"
|
||||
:label="$t('chart.gradient')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="colorForm.gradient"
|
||||
@change="changeColorCase('gradient')"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-show="showProperty('quotaColor')"
|
||||
:label="$t('chart.quota_color')"
|
||||
|
@ -225,7 +225,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="chart.type === 'table-pivot'"
|
||||
v-if="false && chart.type === 'table-pivot'"
|
||||
:label="$t('chart.total_sort')"
|
||||
class="form-item"
|
||||
>
|
||||
@ -239,7 +239,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="chart.type === 'table-pivot' && totalForm.col.totalSort !== 'none'"
|
||||
v-if="false && chart.type === 'table-pivot' && totalForm.col.totalSort !== 'none'"
|
||||
:label="$t('chart.total_sort_field')"
|
||||
class="form-item"
|
||||
>
|
||||
@ -422,12 +422,15 @@ export default {
|
||||
this.totalSortFields = JSON.parse(chart.yaxis)
|
||||
}
|
||||
if (this.totalSortFields.length > 0) {
|
||||
if (this.totalForm.row.totalSortField === '') {
|
||||
if (this.resetTotalSort(this.totalForm.row.totalSortField)) {
|
||||
this.totalForm.row.totalSortField = this.totalSortFields[0].dataeaseName
|
||||
}
|
||||
if (this.totalForm.col.totalSortField === '') {
|
||||
if (this.resetTotalSort(this.totalForm.col.totalSortField)) {
|
||||
this.totalForm.col.totalSortField = this.totalSortFields[0].dataeaseName
|
||||
}
|
||||
} else {
|
||||
this.totalForm.row.totalSortField = ''
|
||||
this.totalForm.col.totalSortField = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -437,6 +440,16 @@ export default {
|
||||
},
|
||||
showProperty(property) {
|
||||
return this.propertyInner.includes(property)
|
||||
},
|
||||
resetTotalSort(field) {
|
||||
if (field === '') {
|
||||
return true
|
||||
}
|
||||
const sortFieldList = []
|
||||
this.totalSortFields.forEach(ele => {
|
||||
sortFieldList.push(ele.dataeaseName)
|
||||
})
|
||||
return sortFieldList.indexOf(field) === -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1655,14 +1655,12 @@ import ScrollCfg from '@/views/chart/components/senior/ScrollCfg'
|
||||
import ChartFieldEdit from '@/views/chart/view/ChartFieldEdit'
|
||||
import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
import MarginSelector from '@/views/chart/components/componentStyle/MarginSelector'
|
||||
import PositionAdjust from '@/views/chart/view/PositionAdjust'
|
||||
|
||||
export default {
|
||||
name: 'ChartEdit',
|
||||
components: {
|
||||
PositionAdjust,
|
||||
MarginSelector,
|
||||
ScrollCfg,
|
||||
CalcChartFieldEdit,
|
||||
ChartFieldEdit,
|
||||
|
@ -136,51 +136,54 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
property="deType"
|
||||
property="deTypeCascader"
|
||||
:label="$t('dataset.field_type')"
|
||||
min-width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.deType"
|
||||
<el-cascader
|
||||
v-model="scope.row.deTypeCascader"
|
||||
size="small"
|
||||
class="select-type"
|
||||
popper-class="select-date-resolution-format"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
class="select-type"
|
||||
:options="getFields(scope.row)"
|
||||
@visible-change="getPopPosition"
|
||||
@change="saveEdit(scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fields"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<span style="float: left">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span
|
||||
v-if="node.level === 2"
|
||||
class="format-title"
|
||||
:style="popPosition"
|
||||
>{{ $t('chart.date_format') }}</span>
|
||||
<span>
|
||||
<svg-icon
|
||||
v-if="item.value === 0"
|
||||
v-if="data.value === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 1"
|
||||
v-if="data.value === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 2 || item.value === 3"
|
||||
v-if="data.value === 2 || data.value === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 5"
|
||||
v-if="data.value === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location field-icon-dimension"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{
|
||||
item.label
|
||||
<span style="color: #8492a6; font-size: 12px">{{
|
||||
data.label
|
||||
}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-cascader>
|
||||
<span class="select-svg-icon">
|
||||
<span v-if="scope.row.deType === 0 || scope.row.deType === 6">
|
||||
<svg-icon
|
||||
@ -211,16 +214,16 @@
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<!-- <el-input-->
|
||||
<!-- v-if="scope.row.deType === 1"-->
|
||||
<!-- v-model="scope.row.dateFormat"-->
|
||||
<!-- :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)"-->
|
||||
<!-- />-->
|
||||
<el-input
|
||||
v-if="scope.row.deType === 1 && scope.row.deExtractType === 0"
|
||||
v-model="scope.row.dateFormat"
|
||||
: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)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -473,51 +476,54 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
property="deType"
|
||||
property="deTypeCascader"
|
||||
:label="$t('dataset.field_type')"
|
||||
min-width="200"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.deType"
|
||||
<el-cascader
|
||||
v-model="scope.row.deTypeCascader"
|
||||
size="small"
|
||||
class="select-type"
|
||||
popper-class="select-date-resolution-format"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
class="select-type"
|
||||
:options="getFields(scope.row)"
|
||||
@visible-change="getPopPosition"
|
||||
@change="saveEdit(scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fields"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<span style="float: left">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span
|
||||
v-if="node.level === 2"
|
||||
class="format-title"
|
||||
:style="popPosition"
|
||||
>{{ $t('chart.date_format') }}</span>
|
||||
<span>
|
||||
<svg-icon
|
||||
v-if="item.value === 0"
|
||||
v-if="data.value === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text field-icon-quota"
|
||||
class="field-icon-text field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 1"
|
||||
v-if="data.value === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time field-icon-quota"
|
||||
class="field-icon-time field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 2 || item.value === 3"
|
||||
v-if="data.value === 2 || data.value === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value field-icon-quota"
|
||||
class="field-icon-value field-icon-dimension"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.value === 5"
|
||||
v-if="data.value === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location field-icon-quota"
|
||||
class="field-icon-location field-icon-dimension"
|
||||
/>
|
||||
</span>
|
||||
<span style="float: left; color: #8492a6; font-size: 12px">{{
|
||||
item.label
|
||||
<span style="color: #8492a6; font-size: 12px">{{
|
||||
data.label
|
||||
}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-cascader>
|
||||
<span class="select-svg-icon">
|
||||
<span v-if="scope.row.deType === 0">
|
||||
<svg-icon
|
||||
@ -548,16 +554,16 @@
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<!-- <el-input-->
|
||||
<!-- v-if="scope.row.deType === 1"-->
|
||||
<!-- v-model="scope.row.dateFormat"-->
|
||||
<!-- :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)"-->
|
||||
<!-- />-->
|
||||
<el-input
|
||||
v-if="scope.row.deType === 1 && scope.row.deExtractType === 0"
|
||||
v-model="scope.row.dateFormat"
|
||||
: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)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -757,7 +763,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dateFormats: [],
|
||||
maxHeight: 'auto',
|
||||
tableFields: {
|
||||
dimensionList: [],
|
||||
@ -765,17 +770,8 @@ export default {
|
||||
dimensionListData: [],
|
||||
quotaListData: []
|
||||
},
|
||||
fields: [
|
||||
{ label: this.$t('dataset.text'), value: 0 },
|
||||
{ label: this.$t('dataset.time'), value: 1 },
|
||||
{ label: this.$t('dataset.value'), value: 2 },
|
||||
{
|
||||
label:
|
||||
this.$t('dataset.value') + '(' + this.$t('dataset.float') + ')',
|
||||
value: 3
|
||||
},
|
||||
{ label: this.$t('dataset.location'), value: 5 }
|
||||
],
|
||||
popPosition: {},
|
||||
dateformats: [],
|
||||
fieldActiveNames: ['d', 'q'],
|
||||
searchField: '',
|
||||
editCalcField: false,
|
||||
@ -811,6 +807,18 @@ export default {
|
||||
that.maxHeight = currentHeight - 56 - 30 - 35 - 26 - 10 - 10 + 'px'
|
||||
}, 10)
|
||||
},
|
||||
getPopPosition(val) {
|
||||
if (!val) return
|
||||
// setTimeout(() => {
|
||||
|
||||
// }, 50)
|
||||
this.$nextTick(() => {
|
||||
const list = document.querySelectorAll('body > .select-date-resolution-format')
|
||||
const ele = list[list.length - 1]
|
||||
const { top, left } = ele?.style
|
||||
this.popPosition = { top: parseInt(top) - 18 + 'px', left: parseInt(left) + 181 + 'px', position: 'fixed' }
|
||||
})
|
||||
},
|
||||
initField() {
|
||||
fieldListDQ(this.param.id).then((response) => {
|
||||
this.tableFields = response.data
|
||||
@ -825,14 +833,47 @@ export default {
|
||||
this.quotaChange()
|
||||
})
|
||||
dateformats(this.param.id).then((response) => {
|
||||
this.dateFormats = response.data
|
||||
const children = (response?.data || []).map(ele => ({ label: ele.dateformat, value: ele.dateformat }))
|
||||
children.push({ label: '自定义', value: 'custom' })
|
||||
this.dateformats = children
|
||||
})
|
||||
},
|
||||
getFields(item) {
|
||||
if(item.deExtractType == 0){
|
||||
const children = this.dateformats
|
||||
return [
|
||||
{ label: this.$t('dataset.text'), value: 0 },
|
||||
{ label: this.$t('dataset.time'), value: 1, children },
|
||||
{ label: this.$t('dataset.value'), value: 2 },
|
||||
{
|
||||
label:
|
||||
this.$t('dataset.value') + '(' + this.$t('dataset.float') + ')',
|
||||
value: 3
|
||||
},
|
||||
{ label: this.$t('dataset.location'), value: 5 }
|
||||
]
|
||||
}else {
|
||||
return [
|
||||
{ label: this.$t('dataset.text'), value: 0 },
|
||||
{ label: this.$t('dataset.time'), value: 1 },
|
||||
{ label: this.$t('dataset.value'), value: 2 },
|
||||
{ label: this.$t('dataset.value') + '(' + this.$t('dataset.float') + ')', value: 3 },
|
||||
{ label: this.$t('dataset.location'), value: 5 }
|
||||
]
|
||||
}
|
||||
},
|
||||
saveEdit(item) {
|
||||
if (item.name && item.name.length > 50) {
|
||||
this.$message.error(this.$t('dataset.field_name_less_50'))
|
||||
return
|
||||
}
|
||||
item.deType = item.deTypeCascader[0]
|
||||
if (item.deTypeCascader.length === 2) { // 时间
|
||||
item.dateFormatType = item.deTypeCascader[1]
|
||||
if(item.dateFormatType !== 'custom'){
|
||||
item.dateFormat = item.dateFormatType
|
||||
}
|
||||
}
|
||||
|
||||
post('/dataset/field/save', item)
|
||||
.then((response) => {
|
||||
@ -1153,3 +1194,16 @@ span {
|
||||
border-bottom: 0 solid #e6ebf5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.select-date-resolution-format {
|
||||
.format-title {
|
||||
position: fixed;
|
||||
display: inline-block;
|
||||
height: 30px;
|
||||
background: #dfe6ec;
|
||||
width: 192px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -162,7 +162,7 @@
|
||||
class="de-card-dropdown"
|
||||
>
|
||||
<template
|
||||
v-if="!['Stopped', 'Exec'].includes(scope.row.status)"
|
||||
v-if="!['Exec'].includes(scope.row.status)"
|
||||
>
|
||||
<el-dropdown-item
|
||||
:disabled="disableExec(scope.row)"
|
||||
@ -858,9 +858,7 @@ export default {
|
||||
},
|
||||
disableExec(task) {
|
||||
return (
|
||||
task.status === 'Stopped' ||
|
||||
task.status === 'Pending' ||
|
||||
task.rate === 'SIMPLE' ||
|
||||
!hasDataPermission('manage', task.privileges)
|
||||
)
|
||||
},
|
||||
|
@ -268,7 +268,7 @@
|
||||
class="de-card-dropdown"
|
||||
>
|
||||
<template
|
||||
v-if="!['Stopped', 'Exec'].includes(scope.row.status)"
|
||||
v-if="!['Exec'].includes(scope.row.status)"
|
||||
>
|
||||
<el-dropdown-item
|
||||
:disabled="disableExec(scope.row)"
|
||||
@ -624,10 +624,7 @@ export default {
|
||||
)
|
||||
},
|
||||
disableExec(task) {
|
||||
return (
|
||||
task.status === 'Stopped' ||
|
||||
task.status === 'Pending' ||
|
||||
task.rate === 'SIMPLE' ||
|
||||
return (task.status === 'Pending' ||
|
||||
!hasDataPermission('manage', task.privileges)
|
||||
)
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user