Merge branch 'dev' into pr@dev_dataset_source

This commit is contained in:
dataeaseShu 2022-09-28 13:05:24 +08:00
commit c6cbc5c666
18 changed files with 77 additions and 58 deletions

View File

@ -109,7 +109,7 @@
<select id="findWecomUser" resultMap="baseMap">
select
user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
from
sys_user_assist a
left join
@ -119,7 +119,7 @@
<select id="findDingtalkUser" resultMap="baseMap">
select
user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
from
sys_user_assist a
left join
@ -129,7 +129,7 @@
<select id="findLarkUser" resultMap="baseMap">
select
user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
u.user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin, `from`
from
sys_user_assist a
left join

View File

@ -150,7 +150,7 @@ public class XDingtalkServer {
public void bind(@RequestParam("code") String code, @RequestParam("state") String state) {
HttpServletResponse response = ServletUtils.response();
String url = "/#personal";
String url = "/#person-info/index";
DingtalkXpackService dingtalkXpackService = null;

View File

@ -151,7 +151,7 @@ public class XLarkServer {
public void bind(@RequestParam("code") String code, @RequestParam("state") String state) {
HttpServletResponse response = ServletUtils.response();
String url = "/#personal";
String url = "/#person-info/index";
LarkXpackService larkXpackService = null;
try {

View File

@ -156,7 +156,7 @@ public class XWecomServer {
@GetMapping("/bind")
public void bind(@RequestParam("code") String code, @RequestParam("state") String state) {
String url = "/#personal";
String url = "/#person-info/index";
HttpServletResponse response = ServletUtils.response();
WecomXpackService wecomXpackService = null;

View File

@ -117,7 +117,7 @@ public class MysqlQueryProvider extends QueryProvider {
if (f.getType().equalsIgnoreCase("YEAR")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originField + ",'-01-01')", MySQLConstants.DEFAULT_DATE_FORMAT);
} else if (f.getType().equalsIgnoreCase("TIME")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(1970-01-01 " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT('1970-01-01', " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = String.format(MySQLConstants.DATE_FORMAT, originField, MySQLConstants.DEFAULT_DATE_FORMAT);
}
@ -176,7 +176,7 @@ public class MysqlQueryProvider extends QueryProvider {
if (f.getType().equalsIgnoreCase("YEAR")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originField + ",'-01-01')", MySQLConstants.DEFAULT_DATE_FORMAT);
} else if (f.getType().equalsIgnoreCase("TIME")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(1970-01-01 " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT('1970-01-01', " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = String.format(MySQLConstants.DATE_FORMAT, originField, MySQLConstants.DEFAULT_DATE_FORMAT);
}
@ -1140,7 +1140,7 @@ public class MysqlQueryProvider extends QueryProvider {
if (x.getType().equalsIgnoreCase("YEAR")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originField + ",'-01-01')", transDateFormat(x.getDateStyle(), x.getDatePattern()));
} else if (x.getType().equalsIgnoreCase("TIME")) {
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(1970-01-01 " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(MySQLConstants.DATE_FORMAT, "CONCAT('1970-01-01', " + originField + ")", MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
fieldName = String.format(MySQLConstants.DATE_FORMAT, originField, format);

View File

@ -647,6 +647,12 @@ public class ChartViewService {
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
break;
case "bar-group":
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisBase = xAxisBase.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
xAxisExt = xAxisExt.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
break;
default:
xAxis = xAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
yAxis = yAxis.stream().filter(item -> StringUtils.isNotEmpty(item.getChartId()) || (!desensitizationList.contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName()))).collect(Collectors.toList());
@ -664,12 +670,14 @@ public class ChartViewService {
}
boolean hasParameters = false;
if (StringUtils.isNotEmpty(table.getSqlVariableDetails())) {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType());
for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) {
if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) {
hasParameters = true;
}
if (parameter.contains("|DE|") && table.getId().equals(parameter.split("|DE|")[0]) && sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter.split("|DE|")[1])) {
hasParameters = true;
}
}
}
@ -1591,10 +1599,7 @@ public class ChartViewService {
}
private String handleVariable(String sql, ChartExtRequest requestList, QueryProvider qp, DataSetTableDTO table, Datasource ds) throws Exception {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType());
if (requestList != null && CollectionUtils.isNotEmpty(requestList.getFilter())) {
for (ChartExtFilterRequest chartExtFilterRequest : requestList.getFilter()) {
if (CollectionUtils.isEmpty(chartExtFilterRequest.getValue())) {
@ -1605,12 +1610,22 @@ public class ChartViewService {
}
for (String parameter : chartExtFilterRequest.getParameters()) {
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parameters)) {
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
sql = sql.replace("${" + parameter + "}", filter);
if(parameter.contains("|DE|")){
if(!parameter.split("|DE|")[0].equals(table.getId())){
continue;
}
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter.split("|DE|")[1])).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parameters)) {
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
sql = sql.replace("${" + parameter.split("|DE|")[1] + "}", filter);
}
}else {
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parameters)) {
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
sql = sql.replace("${" + parameter + "}", filter);
}
}
}
}
}

View File

@ -961,16 +961,14 @@ public class DataSetTableService {
return new ArrayList<>();
}
List<SqlVariableDetails> sqlVariableDetails = new ArrayList<>();
List<String> sqlVariableNames = new ArrayList<>();
for (DatasetTable datasetTable : datasetTables) {
if (StringUtils.isNotEmpty(datasetTable.getSqlVariableDetails())) {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(datasetTable.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
for (SqlVariableDetails sqlVariable : sqlVariables) {
if (!sqlVariableNames.contains(sqlVariable.getVariableName())) {
sqlVariableNames.add(sqlVariable.getVariableName());
sqlVariableDetails.add(sqlVariable);
}
sqlVariable.setId(datasetTable.getId() + "|DE|" + sqlVariable.getVariableName());
sqlVariable.setVariableName("[" + datasetTable.getName() + "]-" + sqlVariable.getVariableName());
sqlVariableDetails.add(sqlVariable);
}
}
}
@ -1063,9 +1061,9 @@ public class DataSetTableService {
Select subSelectTmp = (Select) CCJSqlParserUtil.parse(removeVariables(selectBody.toString(), dsType));
PlainSelect subPlainSelect = ((PlainSelect) subSelectTmp.getSelectBody());
subSelect.setSelectBody(subPlainSelect);
if(dsType.equals(DatasourceTypes.oracle.getType())){
if (dsType.equals(DatasourceTypes.oracle.getType())) {
subSelect.setAlias(new Alias(fromItem.getAlias().toString(), false));
}else {
} else {
subSelect.setAlias(new Alias(fromItem.getAlias().toString()));
}
plainSelect.setFromItem(subSelect);

View File

@ -126,7 +126,7 @@ INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_typ
INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('d55c4d88-3b0a-11ed-8009-0242ac130005', '379c3124-7a30-4c1b-8ae4-de23eaf34b71', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1663915323000, NULL, NULL, NULL);
INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`, `copy_from`, `copy_id`) VALUES ('379c3124-7a30-4c1b-8ae4-de23eaf34b71', 'bdfcc324-1181-46a6-b681-a453517c4ffa', 'dataset', '2', 'user', 1663915323123, NULL, 'admin', NULL, NULL, NULL);
DELETE from `sys_menu` where `menu_id` = 50;

View File

@ -83,10 +83,14 @@ export default {
},
computed: {
linkJumpSetShow() {
return this.curComponent.type === 'view' && !this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType)
return this.curComponent.type === 'view'
&& !this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType)
&& !(this.curComponent.propValue.innerType.includes('table') && this.curComponent.propValue.render === 'echarts')
},
linkageSettingShow() {
return this.curComponent.type === 'view' && !this.linkageExcludeViewType.includes(this.curComponent.propValue.innerType)
return this.curComponent.type === 'view'
&& !this.linkageExcludeViewType.includes(this.curComponent.propValue.innerType)
&& !(this.curComponent.propValue.innerType.includes('table') && this.curComponent.propValue.render === 'echarts')
},
panelInfo() {
return this.$store.state.panel.panelInfo

View File

@ -680,6 +680,7 @@ export default {
}
}
Vue.set(this.element.propValue, 'innerType', chartDetails.type)
Vue.set(this.element.propValue, 'render', chartDetails.render)
if (chartDetails.type === 'richTextView') {
this.$nextTick(() => {
bus.$emit('initCurFields-' + this.element.id)

View File

@ -1545,7 +1545,7 @@ export default {
preview_100_data: 'Show 100 lines data',
invalid_table_check: 'Please sync data first.',
parse_error: 'Parse failed,please check.Referencehttps://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: 'Origin Type',
origin_field_type: 'Field Origin Type',
edit_excel_table: 'Edit Excel Dataset',
edit_excel: 'Edit Excel',
excel_replace: 'Replace',

View File

@ -1462,8 +1462,8 @@ export default {
create_view: '創建視圖',
data_preview: '數據預覽',
field_type: '字段類型',
field_name: '字段名',
field_origin_name: '原始名',
field_name: '字段名',
field_origin_name: '原始名',
field_check: '選中',
update_info: '更新信息',
join_view: '數據關聯',
@ -1545,7 +1545,7 @@ export default {
preview_100_data: '顯示前100行數據',
invalid_table_check: '非直連數據集請先完成數據同步',
parse_error: 'Excel解析失敗請檢查格式、字段等信息。具體參考https://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: '原始類型',
origin_field_type: '字段原始類型',
edit_excel_table: '編輯Excel數據集',
edit_excel: '編輯Excel',
excel_replace: '替換',

View File

@ -1461,8 +1461,8 @@ export default {
create_view: '创建视图',
data_preview: '数据预览',
field_type: '字段类型',
field_name: '字段名',
field_origin_name: '原始名',
field_name: '字段名',
field_origin_name: '原始名',
field_check: '选中',
update_info: '更新信息',
join_view: '数据关联',
@ -1544,7 +1544,7 @@ export default {
preview_100_data: '显示前100行数据',
invalid_table_check: '非直连数据集请先完成数据同步',
parse_error: 'Excel解析失败请检查格式、字段等信息。具体参考https://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: '原始类型',
origin_field_type: '字段原始类型',
edit_excel_table: '编辑Excel数据集',
edit_excel: '编辑Excel',
excel_replace: '替换',

View File

@ -46,7 +46,7 @@
<span><i class="el-icon-arrow-down el-icon--right" /></span>
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/personal">
<router-link to="/person-info/index">
<el-dropdown-item>{{ $t('commons.personal_info') }}</el-dropdown-item>
</router-link>

View File

@ -76,11 +76,7 @@ export const constantRoutes = [
component: () => import('@/views/link'),
hidden: true
},
{
path: '/personal',
component: () => import('@/views/system/user/privateForm'),
hidden: true
},
{
path: '/preview/:reportId',
component: () => import('@/components/canvas/components/Editor/PreviewEject'),

View File

@ -107,8 +107,8 @@
<el-checkbox-group v-model="attrs.parameters">
<el-checkbox
v-for="(item ) in childViews.datasetParams"
:key="item.variableName"
:label="item.variableName"
:key="item.id"
:label="item.id"
class="de-checkbox"
>
<div class="span-div">
@ -174,12 +174,27 @@ export default {
{ id: 'HH', name: 'HH' },
{ id: 'HH:mm', name: 'HH:mm' },
{ id: 'HH:mm:ss', name: 'HH:mm:ss' }
]
}
},
computed: {},
watch: {
'childViews.datasetParams': {
handler(newName, oldName) {
if (this.attrs.parameters.length > 0) {
const parameters = []
for (var i = 0; i < this.attrs.parameters.length; i++) {
for (var j = 0; j < this.childViews.datasetParams.length; j++) {
if (this.childViews.datasetParams[j].id.split('|DE|')[1] === this.attrs.parameters[i]) {
parameters.push(this.childViews.datasetParams[j].id)
}
}
}
this.attrs.parameters = parameters
}
}
}
},
created() {
this.attrs = this.controlAttrs
@ -213,6 +228,7 @@ export default {
},
showTitleChange(value) {
if (!value) {
this.attrs.title = ''
this.element.style.backgroundColor = ''
}
this.fillAttrs2Filter()

View File

@ -60,7 +60,6 @@
<el-dropdown-item icon="el-icon-copy-document" @click.native="downloadToTemplate">{{ $t('panel.export_to_panel') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-notebook-2" @click.native="downloadAsPDF">{{ $t('panel.export_to_pdf') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-picture-outline" @click.native="downloadAsImage">{{ $t('panel.export_to_img') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-s-data" @click.native="downLoadToApp">{{ $t('panel.export_to_app') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>

View File

@ -165,16 +165,6 @@
</el-select>
</el-form-item>
<el-form-item v-show="isPluginLoaded && wecomOpen" :label="$t('user.wecom_id')">
<el-input v-model="form.sysUserAssist.wecomId" :placeholder="$t('user.input_wecom_id')" />
</el-form-item>
<el-form-item v-show="isPluginLoaded && dingTalkOpen" :label="$t('user.dingtalk_id')">
<el-input v-model="form.sysUserAssist.dingtalkId" :placeholder="$t('user.input_dingtalk_id')" />
</el-form-item>
<el-form-item v-show="isPluginLoaded && larkOpen" :label="$t('user.lark_id')">
<el-input v-model="form.sysUserAssist.larkId" :placeholder="$t('user.input_lark_id')" />
</el-form-item>
<el-form-item :label="$t('commons.status')" prop="enabled">
<el-switch
v-model="form.enabled"