Merge branch 'dev-v2' into pr@dev-v2@feat_history-check

This commit is contained in:
王嘉豪 2024-11-18 17:27:32 +08:00 committed by GitHub
commit 223e1c37fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 120 additions and 29 deletions

View File

@ -507,6 +507,12 @@ public class SqlparserUtils {
if (StringUtils.isEmpty(sql)) {
DEException.throwException(Translator.get("i18n_sql_not_empty"));
}
try {
removeVariables(sql, "");
} catch (Exception e) {
DEException.throwException(e);
}
sql = sql.trim();
if (sql.endsWith(";")) {
sql = sql.substring(0, sql.length() - 1);

View File

@ -74,6 +74,9 @@ public class SysParameterServer implements SysParameterApi {
if (StringUtils.isNotBlank(settingItemVO.getPkey()) && settingItemVO.getPkey().equalsIgnoreCase(XpackSettingConstants.DEFAULT_SORT) && StringUtils.isNotBlank(settingItemVO.getPval())) {
map.put(XpackSettingConstants.DEFAULT_SORT, settingItemVO.getPval());
}
if (StringUtils.isNotBlank(settingItemVO.getPkey()) && settingItemVO.getPkey().equalsIgnoreCase(XpackSettingConstants.DEFAULT_OPEN) && StringUtils.isNotBlank(settingItemVO.getPval())) {
map.put(XpackSettingConstants.DEFAULT_OPEN, settingItemVO.getPval());
}
}
return map;
}

View File

@ -234,8 +234,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
}
}
});
datasourceIdMap.putAll(appData.getDatasourceInfo().stream()
.collect(Collectors.toMap(AppCoreDatasourceVO::getId, AppCoreDatasourceVO::getSystemDatasourceId)));
datasourceIdMap.putAll(appData.getDatasourceInfo().stream().collect(Collectors.toMap(AppCoreDatasourceVO::getId, AppCoreDatasourceVO::getSystemDatasourceId)));
Long datasetFolderPid = request.getDatasetFolderPid();
String datasetFolderName = request.getDatasetFolderName();
//新建数据集分组
@ -327,8 +326,8 @@ public class DataVisualizationServer implements DataVisualizationApi {
}
});
if(dsGroupNameSave.contains(dsGroup.getName())){
dsGroup.setName(dsGroup.getName()+"-"+UUID.randomUUID().toString());
if (dsGroupNameSave.contains(dsGroup.getName())) {
dsGroup.setName(dsGroup.getName() + "-" + UUID.randomUUID().toString());
}
dsGroupNameSave.add(dsGroup.getName());
datasetGroupManage.innerSave(dsGroup);
@ -746,26 +745,19 @@ public class DataVisualizationServer implements DataVisualizationApi {
List<VisualizationLinkJumpInfoVO> linkJumpInfoVOInfo = appTemplateMapper.findAppLinkJumpInfoInfo(dvId);
List<VisualizationLinkJumpTargetViewInfoVO> listJumpTargetViewInfoVO = appTemplateMapper.findAppLinkJumpTargetViewInfoInfo(dvId);
return new VisualizationExport2AppVO(chartViewVOInfo, datasetGroupVOInfo, datasetTableVOInfo,
datasetTableFieldVOInfo, datasourceVOInfo, datasourceTaskVOInfo,
linkJumpVOInfo, linkJumpInfoVOInfo, listJumpTargetViewInfoVO, linkageVOInfo, linkageFieldVOInfo);
return new VisualizationExport2AppVO(chartViewVOInfo, datasetGroupVOInfo, datasetTableVOInfo, datasetTableFieldVOInfo, datasourceVOInfo, datasourceTaskVOInfo, linkJumpVOInfo, linkJumpInfoVOInfo, listJumpTargetViewInfoVO, linkageVOInfo, linkageFieldVOInfo);
}
@Override
public void nameCheck(DataVisualizationBaseRequest request) {
QueryWrapper<DataVisualizationInfo> wrapper = new QueryWrapper<>();
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOpt())) {
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt()) || DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt()) || DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt()) || DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOpt())) {
if (request.getPid() == null) {
DataVisualizationInfo result = visualizationInfoMapper.selectById(request.getId());
request.setPid(result.getPid());
}
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt())) {
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt()) || DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt()) || DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt())) {
wrapper.ne("id", request.getId());
}
}
@ -812,12 +804,10 @@ public class DataVisualizationServer implements DataVisualizationApi {
}
public void getParent(List<DataVisualizationInfo> list, DataVisualizationInfo dataVisualizationInfo) {
if (ObjectUtils.isNotEmpty(dataVisualizationInfo)) {
if (dataVisualizationInfo.getPid() != null) {
DataVisualizationInfo d = visualizationInfoMapper.selectById(dataVisualizationInfo.getPid());
list.add(d);
getParent(list, d);
}
if (ObjectUtils.isNotEmpty(dataVisualizationInfo) && dataVisualizationInfo.getPid() != null && !dataVisualizationInfo.getPid().equals(dataVisualizationInfo.getId())) {
DataVisualizationInfo d = visualizationInfoMapper.selectById(dataVisualizationInfo.getPid());
list.add(d);
getParent(list, d);
}
}

View File

@ -1,6 +1,8 @@
INSERT INTO `core_sys_setting`(`id`, `pkey`, `pval`, `type`, `sort`)
VALUES (1048232869488627719, 'basic.defaultSort', '1', 'text', 13);
INSERT INTO `core_sys_setting`(`id`, `pkey`, `pval`, `type`, `sort`)
VALUES (1048232869488627719, 'basic.defaultOpen', '1', 'text', 14);
ALTER TABLE `data_visualization_info`
ADD COLUMN `content_id` varchar(50) NULL DEFAULT '0' COMMENT '内容标识';
ADD COLUMN `content_id` varchar(50) NULL DEFAULT '0' COMMENT '内容标识';

View File

@ -1,6 +1,9 @@
INSERT INTO `core_sys_setting`(`id`, `pkey`, `pval`, `type`, `sort`)
VALUES (1048232869488627719, 'basic.defaultSort', '1', 'text', 13);
INSERT INTO `core_sys_setting`(`id`, `pkey`, `pval`, `type`, `sort`)
VALUES (1048232869488627719, 'basic.defaultOpen', '0', 'text', 14);
INSERT INTO `core_menu` VALUES (70, 0, 1, 'msg', NULL, 200, NULL, '/msg', 1, 1, 0);
UPDATE `xpack_setting_authentication` set `synced` = 0 where `name` = 'oidc' or name = 'cas';

View File

@ -126,6 +126,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'
@ -146,6 +150,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'

View File

@ -10,6 +10,7 @@ import {
getToday,
getYesterday,
getMonthBeginning,
getMonthEnd,
getYearBeginning,
getCustomTime
} from './time-format'
@ -141,6 +142,9 @@ const init = () => {
case 'monthBeginning':
selectValue.value = getMonthBeginning()
break
case 'monthEnd':
selectValue.value = getMonthEnd()
break
case 'yearBeginning':
selectValue.value = getYearBeginning()
break

View File

@ -1873,6 +1873,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'
@ -1893,6 +1897,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'

View File

@ -138,6 +138,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'
@ -158,6 +162,10 @@ const relativeToCurrentList = computed(() => {
label: t('dynamic_time.firstOfMonth'),
value: 'monthBeginning'
},
{
label: t('dynamic_time.endOfMonth'),
value: 'monthEnd'
},
{
label: t('dynamic_time.firstOfYear'),
value: 'yearBeginning'

View File

@ -1,4 +1,5 @@
import type { ManipulateType } from 'dayjs'
import dayjs from 'dayjs'
function getThisYear() {
return new Date(`${new Date().getFullYear()}/1`)
}
@ -41,6 +42,10 @@ function getMonthBeginning() {
return new Date(`${date.getFullYear()}/${date.getMonth() + 1}/1`)
}
function getMonthEnd() {
return new Date(dayjs().endOf('month').format('YYYY/MM/DD HH:mm:ss'))
}
function getYearBeginning() {
const date = new Date()
return new Date(`${date.getFullYear()}/1/1`)
@ -211,6 +216,12 @@ function getDynamicRange({
isDateTime ? monthBeginningVal : monthBeginningVal + 24 * 3600 * 1000 - 1000
]
break
case 'monthEnd':
const monthEndVal = getMonthEnd().getTime()
selectValue = isDateTime
? [monthEndVal, monthEndVal]
: [monthEndVal - 24 * 3600 * 1000 + 1000, monthEndVal]
break
case 'yearBeginning':
const yearBeginningVal = getYearBeginning().getTime()
selectValue = [
@ -251,6 +262,7 @@ export {
getToday,
getYesterday,
getMonthBeginning,
getMonthEnd,
getYearBeginning,
getCustomTime,
getDynamicRange

View File

@ -3065,7 +3065,8 @@ export default {
defaultLogin: '默認登錄方式',
shareDisable: '禁用分享',
sharePeRequire: '分享有效期密碼必填',
defaultSort: '資源默認排序方式'
defaultSort: '資源默認排序方式',
defaultOpen: '頁面打開方式'
},
resource_sort: {
time_asc: '按創建時間升序',
@ -3073,6 +3074,10 @@ export default {
name_asc: '按名稱升序',
name_desc: '按名稱降序'
},
open_opt: {
new_page: '新頁面打開',
local_page: '當前頁面打開'
},
setting_email: {
title: '郵件設置',
host: 'SMTP主機',

View File

@ -407,6 +407,7 @@ export default {
today: '今天',
yesterday: '昨天',
firstOfMonth: '月初',
endOfMonth: '月底',
firstOfYear: '年初',
custom: '自定义',
date: '日',
@ -639,6 +640,7 @@ export default {
edit_embedded_application: '编辑嵌入式应用',
application_name: '应用名称',
cross_domain_settings: '跨域设置',
embedded_secret_len_change: '密钥长度变化密钥即将重置是否确认',
embedded_management: '嵌入式管理',
to_5_applications: '最多支持创建5个应用',
update_app_secret: '确定更新APP Secret吗',
@ -691,7 +693,8 @@ export default {
the_minimum_date: '请选择最小日期',
the_maximum_date: '请选择最大日期',
on_the_left_p: '请选择左侧变量',
edit_variable_value: '编辑变量值'
edit_variable_value: '编辑变量值',
secret_length: '密钥长度'
},
components: {
dashboard_style: '仪表板风格',
@ -3074,7 +3077,8 @@ export default {
defaultLogin: '默认登录方式',
shareDisable: '禁用分享',
sharePeRequire: '分享有效期密码必填',
defaultSort: '资源默认排序方式'
defaultSort: '资源默认排序方式',
defaultOpen: '页面打开方式'
},
resource_sort: {
time_asc: '按创建时间升序',
@ -3082,6 +3086,10 @@ export default {
name_asc: '按名称升序',
name_desc: '按名称降序'
},
open_opt: {
new_page: '新页面打开',
local_page: '当前页面打开'
},
setting_email: {
title: '邮件设置',
host: 'SMTP主机',

View File

@ -605,5 +605,5 @@ strong {
}
.ed-message .ed-message__closeBtn:hover {
background: #ebebebe6;
background: #ebebebe6 !important;
}

View File

@ -41,6 +41,10 @@ const state = reactive({
{ value: '1', label: t('resource_sort.time_desc') },
{ value: '2', label: t('resource_sort.name_asc') },
{ value: '3', label: t('resource_sort.name_desc') }
],
openOptions: [
{ value: '0', label: t('open_opt.new_page') },
{ value: '1', label: t('open_opt.local_page') }
]
})
@ -125,11 +129,12 @@ const closeLoading = () => {
loadingInstance.value?.close()
}
const edit = (list, orgOptions, roleOptions, loginOptions, sortOptions) => {
const edit = (list, orgOptions, roleOptions, loginOptions, sortOptions, openOptions) => {
state.orgOptions = orgOptions || []
state.roleOptions = roleOptions || []
state.loginOptions = loginOptions || []
state.sortOptions = sortOptions || []
state.openOptions = openOptions || []
state.settingList = list.map(item => {
const pkey = item.pkey
if (pkey === 'basic.logLiveTime' || pkey === 'basic.thresholdLogLiveTime') {
@ -358,6 +363,13 @@ defineExpose({
</el-radio>
</el-radio-group>
</div>
<div v-else-if="item.pkey === 'defaultOpen'">
<el-radio-group v-model="state.form[item.pkey]">
<el-radio v-for="item in state.openOptions" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</div>
<v-else />
</el-form-item>
</el-form>

View File

@ -77,6 +77,10 @@ const state = reactive({
{ value: '1', label: t('resource_sort.time_desc') },
{ value: '2', label: t('resource_sort.name_asc') },
{ value: '3', label: t('resource_sort.name_desc') }
],
openOptions: [
{ value: '0', label: t('open_opt.new_page') },
{ value: '1', label: t('open_opt.local_page') }
]
})
let originData = []
@ -150,6 +154,17 @@ const search = cb => {
} else {
item.pval = state.sortOptions[1].label
}
} else if (item.pkey === 'basic.defaultOpen') {
if (item.pval) {
const r = state.openOptions.filter(cur => cur.value === item.pval)
if (r?.length) {
item.pval = r[0].label
} else {
item.pval = state.openOptions[0].label
}
} else {
item.pval = state.openOptions[0].label
}
} else {
item.pval = item.pval
}
@ -174,7 +189,8 @@ const edit = () => {
cloneDeep(state.orgOptions),
cloneDeep(state.roleOptions),
cloneDeep(state.loginOptions),
cloneDeep(state.sortOptions)
cloneDeep(state.sortOptions),
cloneDeep(state.openOptions)
)
}
const loadOrgOptions = async () => {

@ -1 +1 @@
Subproject commit 1e82eb625b4479fc5659951356f4f23de7f077c4
Subproject commit 9d120aec82118de0493e3c22dc2acc200f74f05a

View File

@ -12,4 +12,6 @@ public class EmbeddedCreator implements Serializable {
private String name;
@Schema(description = "应用域名")
private String domain;
@Schema(description = "密钥长度")
private Integer secretLength = 16;
}

View File

@ -14,4 +14,6 @@ public class EmbeddedEditor implements Serializable {
private String name;
@Schema(description = "应用域名")
private String domain;
@Schema(description = "密钥长度")
private Integer secretLength = 16;
}

View File

@ -22,4 +22,6 @@ public class EmbeddedGridVO implements Serializable {
private String appSecret;
@Schema(description = "应用域名")
private String domain;
@Schema(description = "密钥长度")
private Integer secretLength = 16;
}

View File

@ -11,6 +11,6 @@ public class XpackSettingConstants {
public static final String PVP = "basic.pvp";
public static final String DEFAULT_LOGIN = "basic.defaultLogin";
public static final String THRSHOLD_LOG_LIVE_TIME = "basic.thresholdLogLiveTime";
public static final String DEFAULT_SORT = "basic.defaultSort";
public static final String DEFAULT_OPEN = "basic.defaultOpen";
}