提交 c0928618 authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

......@@ -17,7 +17,7 @@
<where>
FIND_IN_SET(chart_group.id,cids)
</where>
order by create_time desc
order by `type` desc,name asc
</select>
......@@ -27,7 +27,7 @@
<where>
FIND_IN_SET(chart_view.id,cids)
</where>
order by create_time desc
order by `type` desc,name asc
</select>
......
......@@ -7,6 +7,7 @@ public class DeTypeConstants {
public final static Integer DE_INT = 2;
public final static Integer DE_FLOAT = 3;
public final static Integer DE_BOOL = 4;
public final static Integer DE_Binary = 5;
public final static Integer DE_LOCATION = 5;
public final static Integer DE_BINARY = 6;
}
......@@ -19,6 +19,8 @@ public class DorisConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";
......
......@@ -686,9 +686,14 @@ public class DorisQueryProvider extends QueryProvider {
originName = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getDataeaseName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
}
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {
......@@ -738,9 +743,14 @@ public class DorisQueryProvider extends QueryProvider {
originName = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getDataeaseName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
whereName = String.format(DorisConstants.STR_TO_DATE, originName, DorisConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
}
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {
......
......@@ -19,6 +19,8 @@ public class MySQLConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "FROM_UNIXTIME(%s,'%s')";
public static final String STR_TO_DATE = "STR_TO_DATE(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%i:%S";
......
......@@ -671,9 +671,14 @@ public class MysqlQueryProvider extends QueryProvider {
} else {
originName = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
......@@ -721,9 +726,14 @@ public class MysqlQueryProvider extends QueryProvider {
originName = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, MySQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, MySQLConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
......
......@@ -645,7 +645,7 @@ public class OracleQueryProvider extends QueryProvider {
stringBuilder.append(" \"").append(f.getOriginName()).append("\"");
return stringBuilder.toString();
}).toArray(String[]::new);
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), " (" + sqlFix(sql) + ") DE_TMP " );
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), " (" + sqlFix(sql) + ") DE_TMP ");
}
public String transMysqlFilterTerm(String term) {
......@@ -706,9 +706,14 @@ public class OracleQueryProvider extends QueryProvider {
originName = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
......@@ -720,9 +725,13 @@ public class OracleQueryProvider extends QueryProvider {
whereValue = "('" + StringUtils.join(value, "','") + "')";
} else if (StringUtils.containsIgnoreCase(request.getTerm(), "like")) {
whereValue = "'%" + value + "%'";
} else {
if (field.getDeType() == 1) {
whereValue = String.format(OracleConstants.TO_DATE, "'" + value + "'", OracleConstants.DEFAULT_DATE_FORMAT);
} else {
whereValue = String.format(OracleConstants.WHERE_VALUE_VALUE, value);
}
}
list.add(SQLObj.builder()
.whereField(whereName)
.whereTermAndValue(whereTerm + whereValue)
......@@ -756,9 +765,14 @@ public class OracleQueryProvider extends QueryProvider {
originName = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(OracleConstants.TO_DATE, originName, OracleConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(OracleConstants.CAST, originName, OracleConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(OracleConstants.FROM_UNIXTIME, cast, OracleConstants.DEFAULT_DATE_FORMAT);
}
} else {
whereName = originName;
}
......@@ -772,7 +786,9 @@ public class OracleQueryProvider extends QueryProvider {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
whereValue = String.format(OracleConstants.WHERE_BETWEEN, startTime, endTime);
String st = String.format(OracleConstants.TO_DATE, "'" + startTime + "'", OracleConstants.DEFAULT_DATE_FORMAT);
String et = String.format(OracleConstants.TO_DATE, "'" + endTime + "'", OracleConstants.DEFAULT_DATE_FORMAT);
whereValue = st + " AND " + et;
} else {
whereValue = String.format(OracleConstants.WHERE_BETWEEN, value.get(0), value.get(1));
}
......
......@@ -19,6 +19,8 @@ public class PgConstants extends SQLConstants {
public static final String FROM_UNIXTIME = "to_timestamp(%s)";
public static final String TO_DATE = "to_date(%s,'%s')";
public static final String CAST = "CAST(%s AS %s)";
public static final String DEFAULT_DATE_FORMAT = "'YYYY-MM-DD HH24:MI:SS'";
......
......@@ -13,6 +13,7 @@ import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.sqlObj.SQLObj;
import io.dataease.provider.QueryProvider;
import io.dataease.provider.SQLConstants;
import io.dataease.provider.mysql.MySQLConstants;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -73,7 +74,7 @@ public class SqlserverQueryProvider extends QueryProvider {
case "TINYINT":
return DeTypeConstants.DE_BOOL;// 布尔
case "TIMESTAMP":
return DeTypeConstants.DE_Binary;// 二进制
return DeTypeConstants.DE_BINARY;// 二进制
default:
return DeTypeConstants.DE_STRING;
}
......@@ -91,7 +92,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
if (CollectionUtils.isNotEmpty(fields)) {
......@@ -173,7 +174,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
......@@ -270,7 +271,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
......@@ -388,7 +389,7 @@ public class SqlserverQueryProvider extends QueryProvider {
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
.build();
setSchema(tableObj,ds);
setSchema(tableObj, ds);
List<SQLObj> xFields = new ArrayList<>();
List<SQLObj> xWheres = new ArrayList<>();
List<SQLObj> xOrders = new ArrayList<>();
......@@ -588,11 +589,11 @@ public class SqlserverQueryProvider extends QueryProvider {
stringBuilder.append("\"").append(f.getOriginName()).append("\" AS ").append(f.getDataeaseName());
return stringBuilder.toString();
}).toArray(String[]::new);
if(ds != null){
if (ds != null) {
String schema = new Gson().fromJson(ds.getConfiguration(), JdbcDTO.class).getSchema();
String tableWithSchema = String.format(SqlServerSQLConstants.KEYWORD_TABLE, schema) + "." + String.format(SqlServerSQLConstants.KEYWORD_TABLE, table);
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), tableWithSchema);
}else {
} else {
return MessageFormat.format("SELECT {0} FROM {1} ", StringUtils.join(array, ","), table);
}
}
......@@ -651,9 +652,15 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereTerm = transMysqlFilterTerm(request.getTerm());
String whereValue = "";
String originName = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
if (field.getDeType() == DeTypeConstants.DE_TIME && field.getDeExtractType() != DeTypeConstants.DE_TIME) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
......@@ -692,9 +699,14 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereValue = "";
String originName = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(SqlServerSQLConstants.STRING_TO_DATE, originName);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3) {
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originName + "/1000");
whereName = String.format(SqlServerSQLConstants.FROM_UNIXTIME, cast);
}
} else {
whereName = originName;
}
......@@ -744,30 +756,30 @@ public class SqlserverQueryProvider extends QueryProvider {
case "y":
return "CONVERT(varchar(100), datepart(yy, " + originField + "))";
case "y_M":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "substring( convert(varchar," + originField + ",120),1,7)";
}else {
return "replace("+ "substring( convert(varchar," + originField + ",120),1,7), '-','/')";
} else {
return "replace(" + "substring( convert(varchar," + originField + ",120),1,7), '-','/')";
}
case "y_M_d":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "CONVERT(varchar(100), " + originField + ", 23)";
}else {
} else {
return "CONVERT(varchar(100), " + originField + ", 111)";
}
case "H_m_s":
return "CONVERT(varchar(100), " + originField + ", 8)";
case "y_M_d_H_m":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "substring( convert(varchar," + originField + ",120),1,16)";
}else {
return "replace("+ "substring( convert(varchar," + originField + ",120),1,16), '-','/')";
} else {
return "replace(" + "substring( convert(varchar," + originField + ",120),1,16), '-','/')";
}
case "y_M_d_H_m_s":
if(split.equalsIgnoreCase("-")){
if (split.equalsIgnoreCase("-")) {
return "convert(varchar," + originField + ",120)";
}else {
return "replace("+ "convert(varchar," + originField + ",120), '-','/')";
} else {
return "replace(" + "convert(varchar," + originField + ",120), '-','/')";
}
default:
return "convert(varchar," + originField + ",120)";
......@@ -790,7 +802,7 @@ public class SqlserverQueryProvider extends QueryProvider {
String cast = String.format(SqlServerSQLConstants.STRING_TO_DATE, originField);
fieldName = transDateFormat(x.getDateStyle(), x.getDatePattern(), cast);
} else {// 数值转时间
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originField+ "/1000");
String cast = String.format(SqlServerSQLConstants.LONG_TO_DATE, originField + "/1000");
fieldName = transDateFormat(x.getDateStyle(), x.getDatePattern(), cast);
}
} else {
......
......@@ -42,7 +42,7 @@
"vue-axios": "3.2.4",
"vue-clipboard2": "0.3.1",
"vue-codemirror": "^4.0.6",
"vue-fullscreen": "^2.5.1",
"vue-fullscreen": "^2.5.2",
"vue-i18n": "7.3.2",
"vue-router": "3.0.6",
"vue-uuid": "2.0.2",
......
......@@ -1176,7 +1176,7 @@ export default {
if (this.canvasStyleData.auxiliaryMatrix) {
this.recordMatrixCurStyle()
}
this.hasMove && this.$store.commit('recordSnapshot')
this.hasMove && this.$store.commit('recordSnapshot', 'handleUp')
// 记录snapshot后 移动已记录设置为false
this.hasMove = false
......
......@@ -87,13 +87,13 @@ export default {
paste() {
this.$store.commit('paste', true)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'paste')
},
deleteComponent() {
this.deleteCurCondition()
this.$store.commit('deleteComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'deleteComponent')
this.$store.commit('setCurComponent', { component: null, index: null })
},
......@@ -106,22 +106,22 @@ export default {
upComponent() {
this.$store.commit('upComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'upComponent')
},
downComponent() {
this.$store.commit('downComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'downComponent')
},
topComponent() {
this.$store.commit('topComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'topComponent')
},
bottomComponent() {
this.$store.commit('bottomComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'bottomComponent')
}
}
}
......
......@@ -86,13 +86,13 @@ export default {
paste() {
this.$store.commit('paste', true)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','paste')
},
deleteComponent() {
this.deleteCurCondition()
this.$store.commit('deleteComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','deleteComponent')
this.$store.commit('setCurComponent', { component: null, index: null })
},
......@@ -105,22 +105,22 @@ export default {
upComponent() {
this.$store.commit('upComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','upComponent')
},
downComponent() {
this.$store.commit('downComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','downComponent')
},
topComponent() {
this.$store.commit('topComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','topComponent')
},
bottomComponent() {
this.$store.commit('bottomComponent')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','bottomComponent')
},
linkageSetting() {
debugger
......
......@@ -292,17 +292,17 @@ export default {
},
deep: true
},
canvasStyleData: {
handler(newVal, oldVla) {
// 第一次变化 不需要 重置边界 待改进
if (this.changeIndex++ > 0) {
this.resizeParentBounds()
this.$store.state.styleChangeTimes++
}
// this.changeScale()
},
deep: true
},
// canvasStyleData: {
// handler(newVal, oldVla) {
// // 第一次变化 不需要 重置边界 待改进
// if (this.changeIndex++ > 0) {
// // this.resizeParentBounds()
// this.$store.state.styleChangeTimes++
// }
// // this.changeScale()
// },
// deep: true
// },
componentData: {
handler(newVal, oldVla) {
// console.log('11111')
......
......@@ -154,8 +154,7 @@ export default {
}
},
styleChange() {
debugger
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}
......
......@@ -206,7 +206,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}
......
......@@ -189,7 +189,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}
......
......@@ -214,12 +214,12 @@ export default {
compose() {
this.$store.commit('compose')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','compose')
},
decompose() {
this.$store.commit('decompose')
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','decompose')
},
undo() {
......@@ -267,7 +267,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleFileChange')
}
img.src = fileResult
......@@ -306,7 +306,7 @@ export default {
clearCanvas() {
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','clearCanvas')
},
handlePreviewChange() {
......
......@@ -67,6 +67,7 @@ export default {
methods: {
handleInput(e) {
this.$emit('input', this.element, e.target.innerHTML)
this.$store.commit('recordStyleChange')
},
handleKeydown(e) {
......
......@@ -96,7 +96,7 @@ export default {
component.style.left = e.offsetX
component.id = generateID()
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleDrop')
},
handleDragOver(e) {
......
......@@ -52,6 +52,11 @@ export default {
refreshSaveStatus(state) {
state.changeTimes = 0
state.lastSaveSnapshotIndex = deepCopy(state.snapshotIndex)
},
recordStyleChange(state) {
if (state.curComponent) {
state.styleChangeTimes++
}
}
}
}
......@@ -86,7 +86,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}
......
......@@ -142,7 +142,7 @@ export default {
}
this.setCondition()
this.styleChange()
this.$store.commit('recordStyleChange')
})
},
setCondition() {
......@@ -177,7 +177,7 @@ export default {
}
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
}
......
......@@ -104,7 +104,7 @@ export default {
this.inDraw && this.$store.commit('addViewFilter', param)
},
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
......
......@@ -211,7 +211,7 @@ export default {
// return data[this.defaultProp.label].indexOf(value) !== -1
// },
styleChange() {
this.$store.state.styleChangeTimes++
this.$store.commit('recordStyleChange')
}
}
......
......@@ -241,7 +241,10 @@ export default {
trackClick(trackAction) {
const param = this.pointParam
if (!param || !param.data || !param.data.dimensionList) {
// 地图提示没有关联字段 其他没有维度信息的 直接返回
if (this.chart.type === 'map') {
this.$warning(this.$t('panel.no_drill_field'))
}
return
}
const linkageParam = {
......
......@@ -115,7 +115,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','handleFileChange')
}
img.src = fileResult
......
......@@ -80,7 +80,7 @@ export default {
const canvasStyleData = deepCopy(this.canvasStyleData)
canvasStyleData.panel = this.panel
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','commitStyle')
},
onChangeType() {
this.commitStyle()
......
......@@ -44,7 +44,7 @@ export default {
const canvasStyleData = deepCopy(this.canvasStyleData)
canvasStyleData.panel = this.panel
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','onChangePanelStyle')
}
}
}
......
......@@ -189,7 +189,7 @@ export default {
},
subjectChange() {
this.$store.commit('setCanvasStyle', JSON.parse(this.subjectItem.details))
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','subjectChange')
bus.$emit('onSubjectChange')
},
templateEdit() {
......
......@@ -135,7 +135,7 @@ export default {
chart.customFilter = JSON.stringify(this.chart.customFilter)
canvasStyleData.chart = chart
this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot','save')
}
}
}
......
......@@ -311,6 +311,7 @@ export default {
this.init(newVal.id)
},
'$store.state.styleChangeTimes'() {
// console.log('styleChangeTimes' + this.$store.state.styleChangeTimes)
if (this.$store.state.styleChangeTimes > 0) {
this.destroyTimeMachine()
this.recordStyleChange(this.$store.state.styleChangeTimes)
......@@ -383,7 +384,7 @@ export default {
// this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
const panelStyle = JSON.parse(response.data.panelStyle)
this.$store.commit('setCanvasStyle', panelStyle)
this.$store.commit('recordSnapshot')// 记录快照
this.$store.commit('recordSnapshot', 'init')// 记录快照
// 刷新联动信息
getPanelAllLinkageInfo(panelId).then(rsp => {
this.$store.commit('setNowPanelTrackInfo', rsp.data)
......@@ -493,7 +494,7 @@ export default {
component.style.left = this.getPositionX(e.layerX)
component.id = newComponentId
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'handleDrop')
this.clearCurrentInfo()
// // 文字组件
......@@ -545,7 +546,7 @@ export default {
// this.$store.commit('addComponent', { component })
this.$store.commit('setComponentWithId', component)
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'sureFilter')
this.cancelFilter()
},
reFreshComponent(component) {
......@@ -625,7 +626,7 @@ export default {
}
})
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'handleFileChange')
}
img.src = fileResult
......@@ -677,7 +678,7 @@ export default {
component.style.left = 600
component.id = newComponentId
this.$store.commit('addComponent', { component })
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'newViewInfo')
this.clearCurrentInfo()
this.$store.commit('setCurComponent', { component: component, index: this.componentData.length - 1 })
......@@ -703,7 +704,7 @@ export default {
recordStyleChange(index) {
this.timeMachine = setTimeout(() => {
if (index === this.$store.state.styleChangeTimes) {
this.$store.commit('recordSnapshot')
this.$store.commit('recordSnapshot', 'recordStyleChange')
this.$store.state.styleChangeTimes = 0
}
this.destroyTimeMachine()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论