Compare commits

...

9 Commits
dev-v2 ... v2.6

11 changed files with 74 additions and 29 deletions

View File

@ -44,6 +44,7 @@ curl -sSL https://dataease.oss-cn-hangzhou.aliyuncs.com/quick_start_v2.sh | bash
如你有更多问题可以查看在线文档或者通过论坛与我们交流
- [在线体验](https://dataease.io/demo.html)
- [在线文档](https://dataease.io/docs/)
- [社区论坛](https://bbs.fit2cloud.com/c/de/6)
- [入门视频](https://www.bilibili.com/video/BV1Z84y1X7eF/)

View File

@ -16,6 +16,7 @@ import org.apache.commons.collections4.MapUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import static org.apache.calcite.sql.SqlKind.*;
@ -143,7 +144,7 @@ public class SqlUtils {
public static String replaceTablePlaceHolder(String s, String placeholder) {
s = s.replaceAll("\r\n", " ")
.replaceAll("\n", " ")
.replaceAll(SqlPlaceholderConstants.TABLE_PLACEHOLDER_REGEX, placeholder)
.replaceAll(SqlPlaceholderConstants.TABLE_PLACEHOLDER_REGEX, Matcher.quoteReplacement(placeholder))
.replaceAll("ASYMMETRIC", "")
.replaceAll("SYMMETRIC", "");
return s;
@ -169,7 +170,7 @@ public class SqlUtils {
if (MapUtils.isNotEmpty(fieldsDialect)) {
for (Map.Entry<String, String> ele : fieldsDialect.entrySet()) {
s = s.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + ele.getKey() + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, ele.getValue());
s = s.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + ele.getKey() + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, Matcher.quoteReplacement(ele.getValue()));
}
}
return s;

View File

@ -63,7 +63,7 @@ public class SQLConstants {
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(18,0)";
public static final String DEFAULT_INT_FORMAT = "DECIMAL(19,0)";
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(26,8)";

View File

@ -27,6 +27,9 @@ public class SysParameterManage {
@Value("${dataease.show-demo-tips:false}")
private boolean showDemoTips;
@Value("${dataease.demo-tips-content:#{null}}")
private String demoTipsContent;
private static final String mapKey = "map.key";
@Resource
@ -95,15 +98,20 @@ public class SysParameterManage {
@XpackInteract(value = "perSetting", replace = true)
public List<Object> getUiList() {
Map<String, Object> loginTipsItem = new HashMap<>();
loginTipsItem.put("pkey", "showDemoTips");
loginTipsItem.put("pval", showDemoTips);
loginTipsItem.put("sort", 1);
List<Object> result = new ArrayList<>();
result.add(loginTipsItem);
result.add(buildSettingItem("community", true));
result.add(buildSettingItem("showDemoTips", showDemoTips));
result.add(buildSettingItem("demoTipsContent", demoTipsContent));
return result;
}
private Map<String, Object> buildSettingItem(String pkey, Object pval) {
Map<String, Object> item = new HashMap<>();
item.put("pkey", pkey);
item.put("pval", pval);
return item;
}
@Transactional
public void saveGroup(List<SettingItemVO> vos, String groupKey) {

View File

@ -23,6 +23,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -52,6 +54,8 @@ public class TemplateCenterManage {
*/
public TemplateManageFileDTO getTemplateFromMarket(String templateUrl) {
if (StringUtils.isNotEmpty(templateUrl)) {
String templateName = templateUrl.substring(templateUrl.lastIndexOf("/")+1,templateUrl.length());
templateUrl = templateUrl.replace(templateName,URLEncoder.encode(templateName, StandardCharsets.UTF_8).replace("+", "%20"));
String sufUrl = sysParameterManage.groupVal("template.").get("template.url");
String templateInfo = HttpClientUtil.get(sufUrl + templateUrl, null);
return JsonUtil.parseObject(templateInfo, TemplateManageFileDTO.class);

View File

@ -21,6 +21,8 @@ interface AppearanceState {
footContent?: string
loaded: boolean
showDemoTips?: boolean
demoTipsContent?: string
community: boolean
}
const { wsCache } = useCache()
export const useAppearanceStore = defineStore('appearanceStore', {
@ -39,7 +41,9 @@ export const useAppearanceStore = defineStore('appearanceStore', {
foot: 'false',
footContent: '',
loaded: false,
showDemoTips: false
showDemoTips: false,
demoTipsContent: '',
community: true
}
},
getters: {
@ -96,6 +100,12 @@ export const useAppearanceStore = defineStore('appearanceStore', {
},
getShowDemoTips(): boolean {
return this.showDemoTips
},
getDemoTipsContent(): string {
return this.demoTipsContent
},
getCommunity(): boolean {
return this.community
}
},
actions: {
@ -121,6 +131,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
const desktop = wsCache.get('app.desktop')
if (desktop) {
this.loaded = true
this.community = true
}
if (this.loaded) {
return
@ -131,14 +142,22 @@ export const useAppearanceStore = defineStore('appearanceStore', {
if (!resData?.length) {
return
}
if (resData.length === 1 && resData[0]?.pkey === 'showDemoTips') {
this.showDemoTips = resData[0].pval
return
}
const data: AppearanceState = { loaded: false }
const data: AppearanceState = { loaded: false, community: true }
let isCommunity = false
resData.forEach(item => {
data[item.pkey] = item.pval
if (item.pkey === 'community') {
isCommunity = true
}
})
data.community = isCommunity
this.community = data.community
if (this.community) {
this.showDemoTips = data.showDemoTips
this.demoTipsContent = data.demoTipsContent
this.loaded = true
return
}
this.navigate = data.navigate
this.help = data.help
this.navigateBg = data.navigateBg

View File

@ -300,7 +300,7 @@ onMounted(() => {
<el-checkbox
:effect="themes"
v-model="state.tableTotalForm.row.showSubTotals"
:disabled="chart.xAxisExt.length < 2"
:disabled="chart.xAxis.length < 2"
@change="changeTableTotal('row')"
>{{ t('chart.show') }}</el-checkbox
>
@ -314,7 +314,7 @@ onMounted(() => {
<el-radio-group
:effect="themes"
v-model="state.tableTotalForm.row.reverseSubLayout"
:disabled="chart.xAxisExt.length < 2"
:disabled="chart.xAxis.length < 2"
@change="changeTableTotal('row')"
>
<el-radio :effect="themes" :label="true">{{ t('chart.total_pos_top') }}</el-radio>
@ -328,7 +328,7 @@ onMounted(() => {
>
<el-input
:effect="themes"
:disabled="chart.xAxisExt.length < 2"
:disabled="chart.xAxis.length < 2"
:placeholder="t('chart.total_label')"
v-model="state.tableTotalForm.row.subLabel"
size="small"
@ -346,7 +346,7 @@ onMounted(() => {
<el-select
:effect="themes"
v-model="state.rowSubTotalItem.dataeaseName"
:disabled="chart.xAxisExt.length < 2"
:disabled="chart.xAxis.length < 2"
:placeholder="t('chart.aggregation')"
@change="changeTotal(state.rowSubTotalItem, state.tableTotalForm.row.calcSubTotals.cfg)"
>
@ -362,7 +362,7 @@ onMounted(() => {
<el-select
:effect="themes"
v-model="state.rowSubTotalItem.aggregation"
:disabled="chart.xAxisExt.length < 2"
:disabled="chart.xAxis.length < 2"
:placeholder="t('chart.aggregation')"
@change="
changeTotalAggr(
@ -522,7 +522,7 @@ onMounted(() => {
<el-checkbox
:effect="themes"
v-model="state.tableTotalForm.col.showSubTotals"
:disabled="chart.xAxis.length < 2"
:disabled="chart.xAxisExt.length < 2"
@change="changeTableTotal('col')"
>{{ t('chart.show') }}</el-checkbox
>
@ -536,7 +536,7 @@ onMounted(() => {
<el-radio-group
:effect="themes"
v-model="state.tableTotalForm.col.reverseSubLayout"
:disabled="chart.xAxis?.length < 2"
:disabled="chart.xAxisExt?.length < 2"
@change="changeTableTotal('col')"
>
<el-radio :effect="themes" :label="true">{{ t('chart.total_pos_left') }}</el-radio>
@ -550,7 +550,7 @@ onMounted(() => {
>
<el-input
:effect="themes"
:disabled="chart.xAxis?.length < 2"
:disabled="chart.xAxisExt?.length < 2"
:placeholder="t('chart.total_label')"
v-model="state.tableTotalForm.col.subLabel"
size="small"
@ -568,7 +568,7 @@ onMounted(() => {
<el-select
:effect="themes"
v-model="state.colSubTotalItem.dataeaseName"
:disabled="chart.xAxis?.length < 2"
:disabled="chart.xAxisExt?.length < 2"
:placeholder="t('chart.aggregation')"
@change="changeTotal(state.colSubTotalItem, state.tableTotalForm.col.calcSubTotals.cfg)"
>
@ -584,7 +584,7 @@ onMounted(() => {
<el-select
:effect="themes"
v-model="state.colSubTotalItem.aggregation"
:disabled="chart.xAxis?.length < 2"
:disabled="chart.xAxisExt?.length < 2"
:placeholder="t('chart.aggregation')"
@change="
changeTotalAggr(

View File

@ -70,13 +70,16 @@ const componentDataNotInMobile = computed(() => {
const newWindow = ref()
const hanedleMessage = event => {
if (event.data?.msgOrigin === 'de-fit2cloud' && !!embeddedStore.token) {
if (
event.data?.msgOrigin === 'de-fit2cloud' &&
!!embeddedStore.token &&
!!embeddedStore.baseUrl
) {
const params = {
embeddedToken: embeddedStore.token
}
params['de-embedded'] = true
const contentWindow = newWindow.value.contentWindow
console.log('call back from dataease!', contentWindow)
contentWindow.postMessage(params, '*')
return
}

View File

@ -36,7 +36,14 @@ const footContent = ref(null)
const loginErrorMsg = ref('')
const xpackLoginHandler = ref()
const showDempTips = ref(false)
const demoTips = '账号admin 密码DataEase@123456 每晚 00:00 重置数据'
const demoTips = computed(() => {
if (!showDempTips.value) {
return ''
}
return (
appearanceStore.getDemoTipsContent || '账号admin 密码DataEase@123456 每晚 00:00 重置数据'
)
})
const state = reactive({
loginForm: {
username: '',

View File

@ -60,7 +60,9 @@ const classBackground = computed(() => {
return {
width: props.width + 'px',
height: props.width * 0.58 + 'px',
background: `url(${imgUrlTrans(thumbnailUrl.value)}) no-repeat`,
background: `url(${imgUrlTrans(thumbnailUrl.value)
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')}) no-repeat`,
'background-size': `100% 100%`
}
})

View File

@ -13,7 +13,7 @@
</modules>
<properties>
<dataease.version>2.6.0</dataease.version>
<dataease.version>2.6.1</dataease.version>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud-alibaba.version>2022.0.0.0</spring-cloud-alibaba.version>