feat(系统设置): 系统设置增加页面打开方式选项

This commit is contained in:
junjun 2024-11-18 16:10:01 +08:00
parent facf7a1477
commit ca0e7f8b38
8 changed files with 49 additions and 4 deletions

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

@ -1,2 +1,5 @@
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);

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';
UPDATE `xpack_setting_authentication` set `synced` = 0 where `name` = 'oidc' or name = 'cas';

View File

@ -3073,6 +3073,10 @@ export default {
name_asc: '按名稱升序',
name_desc: '按名稱降序'
},
open_opt: {
new_page: '新頁面打開',
local_page: '當前頁面打開'
},
setting_email: {
title: '郵件設置',
host: 'SMTP主機',

View File

@ -3082,6 +3082,10 @@ export default {
name_asc: '按名称升序',
name_desc: '按名称降序'
},
open_opt: {
new_page: '新页面打开',
local_page: '当前页面打开'
},
setting_email: {
title: '邮件设置',
host: 'SMTP主机',

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 () => {

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";
}