Merge branch 'dev' into pr@dev_station_msg

This commit is contained in:
dataeaseShu 2022-08-31 16:16:06 +08:00
commit 6871a6b005
30 changed files with 140 additions and 98 deletions

View File

@ -168,9 +168,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
// NOTE: It's highly recommended to use the ESAPI library and
// uncomment the following line to
// avoid encoded attacks.
// value = ESAPI.encoder().canonicalize(value);
// Avoid null characters
/** value = value.replaceAll("", ""); ***/
// Avoid anything between script tags
Pattern scriptPattern = Pattern.compile(
"<[\r\n| | ]*script[\r\n| | ]*>(.*?)</[\r\n| | ]*script[\r\n| | ]*>", Pattern.CASE_INSENSITIVE);

View File

@ -1,5 +1,6 @@
package io.dataease.job.sechedule;
import io.dataease.commons.utils.LogUtil;
import org.quartz.JobExecutionContext;
import java.text.SimpleDateFormat;
@ -12,6 +13,6 @@ import java.util.Date;
public class TestJob extends DeScheduleJob {
@Override
void businessExecute(JobExecutionContext context) {
System.out.println("Test Job -- " + new SimpleDateFormat("HH:mm:ss").format(new Date()));
LogUtil.info("Test Job -- " + new SimpleDateFormat("HH:mm:ss").format(new Date()));
}
}

View File

@ -1,5 +1,6 @@
package io.dataease.listener;
import io.dataease.commons.utils.LogUtil;
import io.dataease.plugins.common.base.domain.DatasetTableTask;
import io.dataease.commons.constants.ScheduleType;
import io.dataease.service.ScheduleService;
@ -23,7 +24,7 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
@Override
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
System.out.println("================= Application start =================");
LogUtil.info("================= Application start =================");
// 项目启动从数据库读取任务加入到Quartz
List<DatasetTableTask> list = dataSetTableTaskService.list(new DatasetTableTask());
for (DatasetTableTask task : list) {

View File

@ -31,12 +31,10 @@ public class RowPermissionMergeListener implements ApplicationListener<Applicati
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
Map<String, RowPermissionTreeService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((RowPermissionTreeService.class));
if (beansOfType.keySet().size() > 0) {
System.out.println("====row permissions merge [start]====");
logger.info("====row permissions merge [start]====");
SysStartupJob sysStartupJob = sysStartupJobMapper.selectByPrimaryKey(JOB_ID);
if (ObjectUtils.isNotEmpty(sysStartupJob) && StringUtils.equalsIgnoreCase(sysStartupJob.getStatus(), "ready")) {
System.out.println("====row permissions merge [doing]====");
logger.info("====row permissions merge [doing]====");
RowPermissionTreeService rowPermissionTreeService = SpringContextUtil.getBean(RowPermissionTreeService.class);
@ -44,7 +42,6 @@ public class RowPermissionMergeListener implements ApplicationListener<Applicati
sysStartupJob.setStatus("done");
sysStartupJobMapper.updateByPrimaryKey(sysStartupJob);
}
System.out.println("====row permissions merge [end]====");
logger.info("====row permissions merge [end]====");
}
}

View File

@ -29,7 +29,6 @@ public class SystemInitListener implements ApplicationListener<ApplicationReadyE
@Override
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
System.out.println("=====initSystem from code [Start]=====");
logger.info("=====initSystem from code [Start]=====");
Integer dataeseVersion = versionMapper.lastSuccessDataEaseVersion();
Integer dataeseCodeVersion = versionMapper.lastDataEaseCodeVersion();
@ -51,8 +50,6 @@ public class SystemInitListener implements ApplicationListener<ApplicationReadyE
codeVersionMapper.insert(codeVersion);
}
logger.info("=====initSystem from code [End]=====");
System.out.println("=====initSystem from code [End]=====");
}
}

View File

@ -64,7 +64,7 @@ public class CasServer {
sysUserService.saveCASUser(name, email);
sysUserEntity = authUserService.getUserByName(name);
}
String realPwd = CodingUtil.md5(sysUserService.defaultPWD());
String realPwd = sysUserEntity.getPassword();
TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build();
String token = JWTUtils.sign(tokenInfo, realPwd);
ServletUtils.setToken(token);

View File

@ -78,7 +78,7 @@ public class SSOServer {
sysUserEntity = authUserService.getUserBySub(ssoUserInfo.getSub());
}
TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build();
String realPwd = CodingUtil.md5(sysUserService.defaultPWD());
String realPwd = sysUserEntity.getPassword();
String token = JWTUtils.sign(tokenInfo, realPwd);
ServletUtils.setToken(token);

View File

@ -213,8 +213,8 @@ public class ApiProvider extends Provider {
if (StringUtils.isNotEmpty(value) && value.startsWith("[")) {
JSONObject o = new JSONObject();
JSONArray jsonArray = jsonObject.getJSONArray(s);
try {
JSONArray jsonArray = jsonObject.getJSONArray(s);
List<JSONObject> childrenField = new ArrayList<>();
for (Object object: jsonArray) {
JSONObject.parseObject(object.toString());

View File

@ -294,7 +294,6 @@ public class MongoQueryProvider extends QueryProvider {
}
if (CollectionUtils.isNotEmpty(yFields)) {
st_sql.add("aggregators", yFields);
// st_sql.add("notUseAs", true);
}
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
@ -497,7 +496,6 @@ public class MongoQueryProvider extends QueryProvider {
}
if (CollectionUtils.isNotEmpty(yFields)) {
st_sql.add("aggregators", yFields);
// st_sql.add("notUseAs", true);
}
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
@ -616,7 +614,6 @@ public class MongoQueryProvider extends QueryProvider {
}
if (CollectionUtils.isNotEmpty(yFields)) {
st_sql.add("aggregators", yFields);
// st_sql.add("notUseAs", true);
}
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);
@ -704,7 +701,6 @@ public class MongoQueryProvider extends QueryProvider {
ST st_sql = stg.getInstanceOf("querySql");
if (CollectionUtils.isNotEmpty(yFields)) {
st_sql.add("aggregators", yFields);
// st_sql.add("notUseAs", true);
}
if (CollectionUtils.isNotEmpty(wheres)) st_sql.add("filters", wheres);
if (ObjectUtils.isNotEmpty(tableObj)) st_sql.add("table", tableObj);

View File

@ -41,6 +41,9 @@ public class VAuthModelService {
}
private List<VAuthModelDTO> filterPrivileges(VAuthModelRequest request, List<VAuthModelDTO> result) {
if(AuthUtils.getUser().getIsAdmin()){
return result;
}
if (request.getPrivileges() != null) {
result = result.stream().filter(vAuthModelDTO -> {
if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getPrivileges() != null && vAuthModelDTO.getPrivileges().contains(request.getPrivileges()))) {

View File

@ -830,14 +830,12 @@ public class ChartViewService {
//如果不是插件视图 走原生逻辑
if (table.getMode() == 0) {// 直连
// Datasource ds = datasourceService.get(table.getDataSourceId());
if (ObjectUtils.isEmpty(ds)) {
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
}
if (StringUtils.isNotEmpty(ds.getStatus()) && ds.getStatus().equalsIgnoreCase("Error")) {
throw new Exception(Translator.get("i18n_invalid_ds"));
}
// DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
datasourceRequest.setDatasource(ds);
DataTableInfoDTO dataTableInfoDTO = gson.fromJson(table.getInfo(), DataTableInfoDTO.class);
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
@ -903,8 +901,6 @@ public class ChartViewService {
data = datasourceProvider.getData(datasourceRequest);
} else if (table.getMode() == 1) {// 抽取
// 连接doris构建doris数据源查询
// Datasource ds = engineService.getDeEngine();
// DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
datasourceRequest.setDatasource(ds);
String tableName = "ds_" + table.getId().replaceAll("-", "_");
datasourceRequest.setTable(tableName);
@ -1154,7 +1150,6 @@ public class ChartViewService {
pluginViewParam.setPluginChartFieldCustomFilters(fieldFilters);
pluginViewParam.setPluginChartExtFilters(panelFilters);
pluginViewParam.setPluginViewLimit(pluginViewLimit);
// pluginViewParam.setUserId(AuthUtils.getUser().getUserId());
return pluginViewParam;
}

View File

@ -38,6 +38,9 @@ public class ViewExportExcel {
private Type tokenType = new TypeToken<List<Map<String, Object>>>() {
}.getType();
private Type fieldTokenType = new TypeToken<List<ChartViewFieldDTO>>() {
}.getType();
@DePermissionProxy(paramIndex = 2)
public List<File> export(String panelId, List<String> viewIds, PermissionProxy proxy) throws Exception {
if (CollectionUtils.isEmpty(viewIds)) {
@ -91,7 +94,7 @@ public class ViewExportExcel {
Map<String, Object> chart = chartViewDTO.getData();
Object objectFields = chart.get("fields");
List<ChartViewFieldDTO> fields = (List<ChartViewFieldDTO>) objectFields;
List<ChartViewFieldDTO> fields = gson.fromJson(gson.toJson(objectFields), fieldTokenType);
List<String> heads = new ArrayList<>();
List<String> headKeys = new ArrayList<>();
fields.forEach(field -> {

View File

@ -952,9 +952,10 @@ public class DataSetTableService {
List<String> sqlVariableNames = new ArrayList<>();
datasetTables.forEach(datasetTable -> {
if (StringUtils.isNotEmpty(datasetTable.getSqlVariableDetails())) {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType());
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
for (SqlVariableDetails sqlVariable : sqlVariables) {
if(!sqlVariableNames.contains(sqlVariable.getVariableName())){
if (!sqlVariableNames.contains(sqlVariable.getVariableName())) {
sqlVariableNames.add(sqlVariable.getVariableName());
sqlVariableDetails.add(sqlVariable);
}
@ -1023,7 +1024,7 @@ public class DataSetTableService {
if (fromItem instanceof SubSelect) {
SelectBody selectBody = ((SubSelect) fromItem).getSelectBody();
SubSelect subSelect = new SubSelect();
Select subSelectTmp = (Select)CCJSqlParserUtil.parse(removeVariables(selectBody.toString()));
Select subSelectTmp = (Select) CCJSqlParserUtil.parse(removeVariables(selectBody.toString()));
PlainSelect subPlainSelect = ((PlainSelect) subSelectTmp.getSelectBody());
subSelect.setSelectBody(subPlainSelect);
subSelect.setAlias(new Alias(fromItem.getAlias().toString()));
@ -1488,7 +1489,7 @@ public class DataSetTableService {
TableUtils.tableName(union.get(0).getCurrentDs().getId()));
}
Map<String, Object> map = new HashMap<>();
map.put("sql", java.util.Base64.getEncoder().encodeToString(sql.getBytes()));
map.put("sql", sql);
map.put("field", checkedFields);
map.put("join", unionList);
return map;
@ -2603,60 +2604,60 @@ public class DataSetTableService {
@Override
public void visit(Between between) {
if(hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())){
if (hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())) {
getBuffer().append(SubstitutedSql);
}else {
} else {
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
}
}
@Override
public void visit(MinorThan minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" < ");
getBuffer().append( minorThan.getRightExpression());
getBuffer().append(minorThan.getRightExpression());
}
@Override
public void visit(MinorThanEquals minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" <= ");
getBuffer().append( minorThan.getRightExpression());
getBuffer().append(minorThan.getRightExpression());
}
@Override
public void visit(GreaterThanEquals minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" >= ");
getBuffer().append( minorThan.getRightExpression());
getBuffer().append(minorThan.getRightExpression());
}
@Override
public void visit(GreaterThan greaterThan) {
if(hasVarible(greaterThan.getLeftExpression().toString()) || hasVarible(greaterThan.getRightExpression().toString())){
if (hasVarible(greaterThan.getLeftExpression().toString()) || hasVarible(greaterThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(greaterThan.getLeftExpression());
getBuffer().append(" > ");
getBuffer().append( greaterThan.getRightExpression());
getBuffer().append(greaterThan.getRightExpression());
}
@Override
public void visit(ExpressionList expressionList) {
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext();) {
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext(); ) {
Expression expression = iter.next();
expression.accept(this);
if (iter.hasNext()) {
@ -2732,7 +2733,9 @@ public class DataSetTableService {
try {
BinaryExpression leftBinaryExpression = (BinaryExpression) expr.getLeftExpression();
hasSubBinaryExpression = leftBinaryExpression.getLeftExpression() instanceof BinaryExpression;
} catch (Exception e) {e.printStackTrace();}
} catch (Exception e) {
e.printStackTrace();
}
if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getLeftExpression().toString())) {
getBuffer().append(SubstitutedSql);
@ -2750,7 +2753,7 @@ public class DataSetTableService {
}
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
} else {
} else {
expr.getRightExpression().accept(this);
}
}

View File

@ -325,27 +325,27 @@ public class ExtractDataService {
try {
deleteFile("all_scope", datasetTableId);
} catch (Exception ignore) {
System.out.println(ignore.getMessage());
LogUtil.error(ignore);
}
try {
sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg);
} catch (Exception ignore) {
System.out.println(ignore.getMessage());
LogUtil.error(ignore);
}
try {
updateTableStatus(datasetTableId, lastExecStatus, execTime);
} catch (Exception ignore) {
System.out.println(ignore.getMessage());
LogUtil.error(ignore);
}
try {
dataSetTableTaskService.updateTaskStatus(datasetTableTask, lastExecStatus);
} catch (Exception ignore) {
System.out.println(ignore.getMessage());
LogUtil.error(ignore);
}
try {
dropDorisTable(TableUtils.tmpName(TableUtils.tableName(datasetTableId)));
} catch (Exception ignore) {
System.out.println(ignore.getMessage());
LogUtil.error(ignore);
}
}
break;

View File

@ -51,7 +51,6 @@ public class PermissionService {
lists.forEach(chartCustomFilterDTO -> {
chartCustomFilterDTO.setFieldId(field.getId());
if(datasetRowPermissions.getAuthTargetType().equalsIgnoreCase("sysParams")){
System.out.println(values.get(chartCustomFilterDTO.getValue()).toString());
chartCustomFilterDTO.setValue(values.get(chartCustomFilterDTO.getValue()).toString());
}
});

View File

@ -78,12 +78,10 @@ public class PluginService {
String folder = pluginDir + "folder/";
try {
ZipUtil.unzip(dest.getAbsolutePath(), folder);
// ZipUtils.unzip(dest, folder);
} catch (Exception e) {
DeFileUtils.deleteFile(pluginDir + "temp/");
DeFileUtils.deleteFile(folder);
// 需要删除文件
// e.printStackTrace();
LogUtil.error(e.getMessage(), e);
DEException.throwException(e);
}
@ -261,7 +259,6 @@ public class PluginService {
} catch (InvocationTargetException e) {
e.printStackTrace();
}
//BeanUtils.copyBean(result, myPlugin);
if(result.getCategory().equalsIgnoreCase("datasource") && (StringUtils.isEmpty(result.getStore()) || !result.getStore().equalsIgnoreCase("default"))){
result.setStore("thirdpart");
}

View File

@ -140,7 +140,6 @@ public class SysUserService {
sysUser.setLanguage("zh_CN");
sysUser.setFrom(3);
sysUser.setIsAdmin(false);
// sysUser.setSub(ssoUserInfo.getSub());
sysUserMapper.insert(sysUser);
SysUser dbUser = findOne(sysUser);
if (null != dbUser && null != dbUser.getUserId()) {

View File

@ -246,7 +246,6 @@ public class LogService {
}
public void saveLog(SysLogDTO sysLogDTO) {
// String ip = "";
CurrentUserDto user = AuthUtils.getUser();
SysLogWithBLOBs sysLogWithBLOBs = BeanUtils.copyBean(new SysLogWithBLOBs(), sysLogDTO);
if (CollectionUtils.isNotEmpty(sysLogDTO.getPositions())) {
@ -266,7 +265,6 @@ public class LogService {
sysLogWithBLOBs.setNickName(sysLogDTO.getSourceName());
}
// sysLogWithBLOBs.setIp(ip);
sysLogMapper.insert(sysLogWithBLOBs);
}

View File

@ -79,3 +79,8 @@ SET
`details` = '{\"width\":1600,\"height\":900,\"scale\":100,\"scaleWidth\":100,\"scaleHeight\":100,\"selfAdaption\":true,\"auxiliaryMatrix\":true,\"openCommonStyle\":true,\"panel\":{\"themeColor\":\"dark\",\"color\":\"#030B2E\",\"imageUrl\":{},\"backgroundType\":\"color\",\"gap\":\"yes\",\"resultMode\":\"all\",\"resultCount\":1000},\"aidedDesign\":{\"showGrid\":false,\"matrixBase\":4},\"refreshViewLoading\":true,\"refreshUnit\":\"minute\",\"refreshTime\":5,\"themeId\":\"c9d63e10-2827-11ed-afd9-69d86fea45a0\",\"chartInfo\":{\"chartTitle\":{\"show\":true,\"fontSize\":\"18\",\"color\":\"#FFFFFF\",\"hPosition\":\"left\",\"vPosition\":\"top\",\"isItalic\":false,\"isBolder\":true,\"remarkShow\":false,\"remark\":\"\",\"remarkBackgroundColor\":\"#ffffffff\",\"fontFamily\":\"Microsoft YaHei\",\"letterSpace\":\"0\",\"fontShadow\":false},\"chartColor\":{\"value\":\"default\",\"colors\":[\"#5470c6\",\"#91cc75\",\"#fac858\",\"#ee6666\",\"#73c0de\",\"#3ba272\",\"#fc8452\",\"#9a60b4\",\"#ea7ccc\"],\"alpha\":100,\"tableHeaderBgColor\":\"#4E81BB\",\"tableItemBgColor\":\"#131E42\",\"tableFontColor\":\"#ffffff\",\"tableStripe\":true,\"dimensionColor\":\"#ffffff\",\"quotaColor\":\"#4E81BB\",\"tableBorderColor\":\"#CCCCCC\",\"seriesColors\":[],\"areaBorderColor\":\"#EBEEF5\"},\"chartCommonStyle\":{\"backgroundColorSelect\":true,\"color\":\"#131E42\",\"alpha\":100,\"borderRadius\":5,\"innerPadding\":0},\"filterStyle\":{\"horizontal\":\"left\",\"vertical\":\"top\",\"color\":\"#FFFFFF\",\"brColor\":\"#4E4B4B\",\"wordColor\":\"#FFFFFF\",\"innerBgColor\":\"#131E42\"},\"tabStyle\":{\"headFontColor\":\"#FFFFFF\",\"headFontActiveColor\":\"#FFFFFF\",\"headBorderColor\":\"\",\"headBorderActiveColor\":\"\"}}}'
WHERE
`id` = 'system_2';
BEGIN;
DELETE from `sys_menu` where `menu_id` = 55;
DELETE from `sys_menu` where `menu_id` = 56;
COMMIT;

View File

@ -85,7 +85,7 @@ i18n_no_all_delete_privilege_folder=This folder have sources which have no manag
i18n_excel_field_repeat=Duplicate fields exist, please modify and try again.
i18n_schema_is_empty=Database schema is empty
\u7AD9\u5185\u6D88\u606F=Internal Messages
\u6240\u6709\u6D88\u606F==All Messages
\u6240\u6709\u6D88\u606F=All Messages
\u672A\u8BFB\u6D88\u606F=Unread Messages
\u5DF2\u8BFB\u6D88\u606F==Read Messages
\u63A5\u6536\u7BA1\u7406=Receive Manage

View File

@ -214,6 +214,8 @@ export default {
methods: {
clearHandler() {
this.value = this.element.options.attrs.multiple ? [] : null
this.checkAll = false
this.isIndeterminate = false
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {

View File

@ -133,12 +133,12 @@ export default {
commons: {
no_result: 'No Result',
manage_member: 'Managing members',
user_confirm_remove_cancel: 'Are you sure you want to remove the user from the role?',
confirm_remove_cancel: 'Are you sure to delete the role?',
user_confirm_remove_cancel: 'Are you sure you want to remove the user from the role?',
default_value: 'Default Value',
params_value: 'Param Value',
publish: 'publish',
input_role_name: 'Enter a role name',
publish: 'publish',
unpublished: 'unpublished',
default_pwd: 'Default Pwd',
stop: 'Stop',
@ -159,9 +159,9 @@ export default {
yes: 'Yes',
no: 'No',
reset: 'Reset',
gender: 'Gender',
catalogue: 'Catalogue',
button: 'Button',
gender: 'Gender',
man: 'Man',
woman: 'Woman',
keep_secret: 'keep secret',
@ -192,6 +192,7 @@ export default {
annotation: 'Annotation',
clear: 'Clean',
save: 'Save',
otherSave: 'Save as',
update: 'Update',
save_success: 'Saved successfully',
delete_success: 'deleted successfully',
@ -400,6 +401,7 @@ export default {
continue: 'continue',
hour: 'hour',
minute: 'minute',
day: 'day',
by_task_name: 'Search by task name',
message_receiving_management: 'Message receiving management',
upload_failed: 'Upload failed',
@ -423,7 +425,6 @@ export default {
uninstall: 'uninstall',
relevant_content_found: 'No relevant content found',
view_tasks: 'View tasks',
day: 'day',
no_classification: 'No classification',
no_template: 'No template',
data_set_required: 'Data set (required)',
@ -602,6 +603,7 @@ export default {
confirm_passwd: 'Confirm Password',
change_password: 'Change Password',
search_by_name: 'Search by name',
import_ldap: 'Import LDAP users',
result_one: 'Results',
clear_filter: 'Empty condition',
recover_pwd: 'Restore to the original password?',
@ -1541,8 +1543,9 @@ export default {
column_permission: {
add: 'Add',
edit: 'Edit',
please_select_field: 'Please select field',
please_select_auth_type: 'Please select the authorization type',
please_select_auth_id: '请选择授权目标',
please_select_auth_id: 'Please select authorization obj',
column_permission_not_empty: 'Please select authorization target',
auth_type: 'Authorization type',
auth_obj: 'Authorized object',
@ -1594,14 +1597,19 @@ export default {
create: 'Create Data Source',
type: 'Type',
please_choose_type: 'Please select data source type',
please_choose_data_type: 'Please select the calculation mode',
data_base: 'Database name',
user_name: 'User Name',
password: 'Password',
host: 'Host name / IP address',
doris_host: 'Doris Addr',
query_port: 'Query Port',
http_port: 'Http Port',
port: 'Port',
datasource_url: 'URL address',
please_input_datasource_url: 'Please enter Elasticsearch 地址e.g: http://es_host:es_port',
please_input_data_base: 'Please enter the database name',
please_select_oracle_type: 'Select connection type',
please_input_user_name: 'Please enter user name',
please_input_password: 'Please enter Password',
please_input_host: 'Please enter host',
@ -1633,9 +1641,6 @@ export default {
min_pool_size: 'Minimum of connections',
max_pool_size: 'Maximum connection',
max_idle_time: 'Maximum idle (seconds)',
doris_host: 'Doris Address',
query_port: 'Query Port',
http_port: 'Http Port',
bucket_num: 'Bucket number',
replication_num: 'Replication number',
please_input_bucket_num: 'Please enter Bucket number',
@ -1648,10 +1653,15 @@ export default {
please_input_max_pool_size: 'Please enter the maximum number of connections',
please_input_max_idle_time: 'Please enter the maximum idle (seconds)',
please_input_acquire_increment: 'Please enter the growth number',
please_input_query_timeout: 'Please enter query timeout',
please_input_connect_timeout: 'Please enter the connection timeout (seconds)',
no_less_then_0: 'Parameters in advanced settings cannot be less than zero',
port_no_less_then_0: 'Port cannot be less than zero',
priority: 'Advanced setting',
data_mode: 'Data mode',
direct: 'Direct Mode',
extract: 'Extraction mode',
all_compute_mode: 'Direct connection and extraction mode',
extra_params: 'Extra JDBC connection string',
please_input_dataPath: 'Please enter the JsonPath data path',
warning: 'Contains invalid table',
@ -1909,6 +1919,8 @@ export default {
fontWeight: 'FontWeight',
lineHeight: 'LineHeight',
letterSpacing: 'LetterSpacing',
padding: 'Internal spacing',
margin: 'Outer space',
textAlign: 'TextAlign',
opacity: 'Opacity',
verticalAlign: 'Vertical Align',
@ -1997,6 +2009,9 @@ export default {
default_settings: 'Default Settings',
choose_background: 'Choose Component Background',
choose_background_tips: 'The component`s own background settings will overwrite the current settings',
setting_background: 'Set background',
setting_jump: 'Jump settings',
select_view: 'Please select a view...',
visual: 'Visual',
prohibit_multiple: 'Prohibit multiple fields in the same dataset',
be_empty_dir: 'is empty dir'
@ -2015,9 +2030,6 @@ export default {
un_install: 'Uninstall',
uninstall_confirm: 'Comfirm to uninstall the plugin?',
uninstall_cancel: 'Cancel uninstall plugin',
setting_background: 'BackGround',
setting_jump: 'Jump Setting',
select_view: 'Select View',
un_install_success: 'Uninstall is successful and restart takes effect',
un_install_error: 'Uninstall failed, please contact the administrator'
},
@ -2029,6 +2041,11 @@ export default {
loginTitle: 'Login page title',
title: 'System name',
advice_size: 'Advice picture size',
theme: 'Theme color',
topMenuColor: 'Head background',
topMenuActiveColor: 'Head selection background',
topMenuTextColor: 'Head font color',
topMenuTextActiveColor: 'Head font selected color',
themeLight: 'Light',
themeDark: 'Dark',
themeCustom: 'Custom',
@ -2040,7 +2057,6 @@ export default {
defaultHomeLink: 'Default is the system built-in home page',
showFoot: 'Show login page footer',
footContent: 'Foot content'
},
auth: {
no_item_selected: 'Please select organization、user or role on the left',
@ -2056,6 +2072,7 @@ export default {
role: 'Role',
user: 'User',
set_rules: 'Set rules',
sysParams: 'System variable',
sysParams_type: {
user_id: 'User ID',
user_name: 'User Name',
@ -2076,6 +2093,7 @@ export default {
datasetAuthHead: 'All Dataset',
chartAuthHead: 'All Chart',
panelAuthHead: 'All Chart',
menuAuthHead: 'All menus and actions',
view: 'View',
use: 'Use',
export: 'Export',
@ -2083,14 +2101,14 @@ export default {
row_column: 'Row and column permission settings',
row_permission: 'Row permission rules',
enable_row: 'Enable row permissions',
add_condition: 'Add condition',
add_relationship: 'Add relationship',
white_list: 'White list',
white_user_not: 'The above permission rules do not take effect for white list users',
organization_or_role: 'Please select an organization or role',
column_permission: 'Column permission rule',
enable_column: 'Enable column permissions',
search_by_field: 'Search by field name',
add_condition: 'Add condition',
add_relationship: 'Add relationship',
filter_fields: 'Filter fields',
selct_filter_fields: 'Please select a filter field',
enter_keywords: 'Please enter keywords',
@ -2201,7 +2219,7 @@ export default {
i18n_msg_type_all: 'All type',
i18n_msg_type_ds_invalid: 'Datasource invalid',
channel_inner_msg: 'On site news',
channel_email_msg: 'Mail notification'
channel_email_msg: 'Email reminder'
},
denumberrange: {
label: 'Number range',
@ -2357,8 +2375,7 @@ export default {
cmonth: 'This Month',
cquarter: 'This Quarter',
lquarter: 'Last Quarter',
cyear: 'This Year',
openHomePage: 'Show Home Page'
cyear: 'This Year'
},
dynamic_year: {
fix: 'Fixed Year',
@ -2371,7 +2388,8 @@ export default {
dynamic: 'Dynamic Month',
current: 'This Month',
last: 'Last Month',
firstOfYear: 'First month of this year'
firstOfYear: 'First month of this year',
sameMonthLastYear: 'Same month last year'
},
wizard: {
welcome_title: 'Welcome To Use DataEase',
@ -2420,7 +2438,9 @@ export default {
plugin_style: {
border: 'Border'
},
sql_variable: {
variable_mgm: 'Parameter setting'
},
map_setting: {
area_level: 'Area Level',
area_code: 'Area Code',
@ -2440,5 +2460,4 @@ export default {
empty: 'Empty',
please_select_map: 'Please select a range of map'
}
}

View File

@ -244,6 +244,21 @@ const data = {
})
},
clearAllViewFilter(state) {
state.componentData.forEach(item => {
if (item.type === 'view' && item.filters && item.filters.length) {
item.filters = []
}
if (item.type === 'de-tabs' && item.options.tabList && item.options.tabList.length) {
item.options.tabList.forEach(tab => {
if (tab.content && tab.content.type === 'view' && tab.content.filters && tab.content.filters.length) {
tab.content.filters = []
}
})
}
})
},
addViewFilter(state, data) {
const condition = formatCondition(data)
const vValid = valueValid(condition)
@ -505,6 +520,7 @@ const data = {
},
// 启用移动端布局
openMobileLayout(state) {
this.commit('clearAllViewFilter')
state.componentDataCache = null
state.componentDataCache = JSON.stringify(state.componentData)
state.pcComponentData = state.componentData

View File

@ -7,7 +7,7 @@ import { valueFormatter } from '@/views/chart/chart/formatter'
let labelFormatter = null
export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
let min, max, labelContent, startAngel, endAngel, tickCount
let min, max, labelContent, startAngel, endAngel
// theme
const theme = getTheme(chart)
// data
@ -31,7 +31,6 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
min = size.gaugeMin ? size.gaugeMin : DEFAULT_SIZE.gaugeMin
max = size.gaugeMax ? size.gaugeMax : DEFAULT_SIZE.gaugeMax
}
tickCount = size.gaugeTickCount ? size.gaugeTickCount : DEFAULT_SIZE.gaugeTickCount
startAngel = parseInt(size.gaugeStartAngle) * Math.PI / 180
endAngel = parseInt(size.gaugeEndAngle) * Math.PI / 180
}
@ -101,13 +100,13 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
content: labelContent
},
axis: {
tickInterval: 1 / tickCount,
tickInterval: 0.2,
label: {
style: {
fontSize: getScaleValue(14, scale) // 刻度值字体大小
},
formatter: function(v) {
return Number(v) * (max - min) + min
return v === '0' ? v : (v * 100 + '%')
}
},
tickLine: {

View File

@ -581,8 +581,8 @@ function mappingColor(value, defaultColor, field, type) {
}
} else {
// time
const tv = new Date(t.value + ' GMT+8').getTime()
const v = new Date(value + ' GMT+8').getTime()
const tv = new Date(t.value.replace(/-/g, '/') + ' GMT+8').getTime()
const v = new Date(value.replace(/-/g, '/') + ' GMT+8').getTime()
if (t.term === 'eq') {
if (v === tv) {
color = t[type]

View File

@ -384,9 +384,9 @@
@change="changeBarSizeCase('gaugeEndAngle')"
/>
</el-form-item>
<el-form-item v-show="showProperty('gaugeTickCount')" :label="$t('chart.tick_count')" class="form-item form-item-slider">
<el-input-number v-model="sizeForm.gaugeTickCount" :min="1" :step="1" :precision="0" size="mini" @change="changeBarSizeCase('gaugeTickCount')" />
</el-form-item>
<!-- <el-form-item v-show="showProperty('gaugeTickCount')" :label="$t('chart.tick_count')" class="form-item form-item-slider">-->
<!-- <el-input-number v-model="sizeForm.gaugeTickCount" :min="1" :step="1" :precision="0" size="mini" @change="changeBarSizeCase('gaugeTickCount')" />-->
<!-- </el-form-item>-->
</el-form>
<!--gauge-end-->

View File

@ -375,7 +375,7 @@
$t('chart.drag_block_word_cloud_label')
}}</span>
<span v-else-if="view.type && view.type === 'label'">{{ $t('chart.drag_block_label') }}</span>
/
<span v-show="view.type !== 'richTextView'"> / </span>
<span v-if="view.type && view.type !== 'table-info'">{{ $t('chart.dimension') }}</span>
<span
v-else-if="view.type && view.type === 'table-info'"
@ -502,7 +502,7 @@
<span v-else-if="view.type && view.type === 'word-cloud'">{{
$t('chart.drag_block_word_cloud_size')
}}</span>
/
<span v-show="view.type !== 'richTextView'"> / </span>
<span>{{ $t('chart.quota') }}</span>
</span>
<draggable

View File

@ -181,7 +181,7 @@
<de-main-container class="ms-main-container">
<div v-if="currentElement.options && currentElement.options.attrs">
<filter-head :element="currentElement" :table-fields-map="tableFieldsMap" :widget="widget" />
<filter-head :element="currentElement" :widget="widget" />
<filter-control :element="currentElement" :widget="widget" :control-attrs="myAttrs" :child-views="childViews" />
@ -297,7 +297,6 @@ export default {
datasetParams: []
},
currentElement: null,
tableFieldsMap: {},
tempTreeDatas: null,
showTips: false
}
@ -632,7 +631,6 @@ export default {
loadField(tableId) {
fieldListWithPermission(tableId).then(res => {
let datas = res.data
this.$set(this.tableFieldsMap, tableId, JSON.parse(JSON.stringify(datas)))
if (this.widget && this.widget.filterFieldMethod) {
datas = this.widget.filterFieldMethod(datas)
}
@ -643,7 +641,6 @@ export default {
comLoadField(tableId) {
fieldListWithPermission(tableId).then(res => {
let datas = res.data
this.$set(this.tableFieldsMap, tableId, JSON.parse(JSON.stringify(datas)))
if (this.widget && this.widget.filterFieldMethod) {
datas = this.widget.filterFieldMethod(datas)
}

View File

@ -18,7 +18,7 @@
>
<v-flex v-for="(item,index) in element.options.attrs.dragItems" :key="item.id">
<drag-item :key="item.id" :is-sort-widget="isSortWidget" :item="item" :index="index" :sort="element.options.attrs.sort" :all-fields="index ? [] : fieldsMap[item.tableId]" @closeItem="closeItem" @sort-change="sortChange" />
<drag-item :key="item.id" :is-sort-widget="isSortWidget" :item="item" :index="index" :sort="element.options.attrs.sort" :all-fields="index ? [] : tableFields" @closeItem="closeItem" @sort-change="sortChange" />
</v-flex>
<span solt="footer">{{ $t('panel.drag_here') }}</span>
@ -34,6 +34,8 @@
<script>
import draggable from 'vuedraggable'
import DragItem from '@/components/DragItem'
import { fieldListWithPermission } from '@/api/dataset/dataset'
export default {
name: 'FilterHead',
components: {
@ -45,10 +47,7 @@ export default {
type: Object,
default: () => {}
},
tableFieldsMap: {
type: Object,
default: () => {}
},
widget: {
type: Object,
default: null
@ -56,25 +55,42 @@ export default {
},
data() {
return {
targets: []
targets: [],
tableFields: []
}
},
computed: {
isSortWidget() {
return this.widget && this.widget.isSortWidget && this.widget.isSortWidget()
},
fieldsMap() {
return JSON.parse(JSON.stringify(this.tableFieldsMap))
firstTableId() {
if (!this.isSortWidget) return null
if (this.element.options.attrs.dragItems && this.element.options.attrs.dragItems.length) {
return this.element.options.attrs.dragItems[0].tableId
}
return null
}
},
watch: {
firstTableId(val, old) {
if (val !== old) {
this.loadFields()
}
}
},
created() {
if (this.isSortWidget && this.element.options.attrs.dragItems && this.element.options.attrs.dragItems.length) {
this.loadFields()
}
},
methods: {
loadFields() {
fieldListWithPermission(this.firstTableId).then(res => {
this.tableFields = JSON.parse(JSON.stringify(res.data))
})
},
onMove(e, originalEvent) {
return true
},

View File

@ -114,6 +114,7 @@
controls-position="right"
:min="1"
size="small"
@change="onSimpleCronChange()"
></el-input-number>
<el-select
v-model="taskForm.extraData.simple_cron_type"