refactor(模板市场): 模板市场显示由基础设置页面控制

This commit is contained in:
wangjiahao 2022-08-02 15:08:11 +08:00
parent e78cd47933
commit f44f43e2d5
9 changed files with 40 additions and 5 deletions

View File

@ -112,6 +112,8 @@ public interface ParamConstants {
MSG_TIME_OUT("basic.msgTimeOut"),
DEFAULT_LOGIN_TYPE("basic.loginType"),
OPEN_HOME_PAGE("ui.openHomePage"),
OPEN_MARKET_PAGE("ui.openMarketPage"),
TEMPLATE_MARKET_ULR("basic.templateMarketUlr"),
TEMPLATE_ACCESS_KEY("basic.templateAccessKey");

View File

@ -20,5 +20,7 @@ public class BasicInfo implements Serializable {
private String templateMarketUlr;
@ApiModelProperty("模板市场AccessKey")
private String templateAccessKey;
@ApiModelProperty("显示模板市场")
private String openMarketPage;
}

View File

@ -40,6 +40,18 @@
AND param_value = 'true'
)
)
AND (
sys_menu.menu_id != 202
OR EXISTS (
SELECT
1
FROM
system_parameter
WHERE
param_key = 'ui.openMarketPage'
AND param_value = 'true'
)
)
ORDER BY
menu_sort
</select>

View File

@ -51,7 +51,9 @@ public class SystemParameterService {
public BasicInfo basicInfo() {
List<SystemParameter> paramList = this.getParamList("basic");
List<SystemParameter> homePageList = this.getParamList("ui.openHomePage");
List<SystemParameter> marketPageList = this.getParamList("ui.openMarketPage");
paramList.addAll(homePageList);
paramList.addAll(marketPageList);
BasicInfo result = new BasicInfo();
result.setOpenHomePage("true");
if (!CollectionUtils.isEmpty(paramList)) {
@ -70,6 +72,10 @@ public class SystemParameterService {
boolean open = StringUtils.equals("true", param.getParamValue());
result.setOpenHomePage(open ? "true" : "false");
}
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.OPEN_MARKET_PAGE.getValue())) {
boolean open = StringUtils.equals("true", param.getParamValue());
result.setOpenMarketPage(open ? "true" : "false");
}
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.TEMPLATE_MARKET_ULR.getValue())) {
result.setTemplateMarketUlr(param.getParamValue());
}

View File

@ -66,7 +66,7 @@ update area_mapping_global set
county_code = concat('156', county_code);
COMMIT;
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (202, 0, 0, 1, '模板市场', 'template-market', 'panel/templateMarket/index', 5, 'dashboard', '/templateMarket', 0, 0, 0, null, NULL, NULL, NULL, 1620444227389);
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (202, 0, 0, 1, '模板市场', 'template-market', 'panel/templateMarket/index', 5, 'dashboard', '/templateMarket', 1, 0, 0, null, NULL, NULL, NULL, 1620444227389);
INSERT INTO `system_parameter` (`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.templateAccessKey', 'dataease', 'text', NULL);
INSERT INTO `system_parameter` (`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.templateMarketUlr', 'https://dataease.io/templates', 'text', 4);
@ -97,3 +97,6 @@ SET
`permission` = 'user:editPwd'
WHERE
`menu_id` = 51;
INSERT INTO `system_parameter` (`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.openMarketPage', 'true', 'boolean', 14);

View File

@ -1896,6 +1896,7 @@ export default {
themeDark: 'Dark',
themeCustom: 'Custom',
openHomePage: 'Show Home Page',
openMarketPage: 'Show Market Page',
mobileBG: 'Mobile Login page BG',
helpLink: 'Help Document Link',
homeLink: 'Home Link',

View File

@ -1904,7 +1904,7 @@ export default {
themeDark: '深色',
themeCustom: '自定義',
openHomePage: '顯示首頁',
openMarketPage: '显示模板市场',
mobileBG: '移動端登錄頁背景',
helpLink: '幫助文檔鏈接',
homeLink: '首頁鏈接',

View File

@ -568,7 +568,7 @@ export default {
filter: '筛选',
list: '列表项',
list_info: '请选择列表中要展示的信息',
sure_delete: '确定删除该用户吗?',
sure_delete: '确定删除该用户吗?'
},
ldap: {
url: 'LDAP地址',
@ -1914,6 +1914,7 @@ export default {
themeDark: '深色',
themeCustom: '自定义',
openHomePage: '显示首页',
openMarketPage: '显示模板市场',
mobileBG: '移动端登录页背景',
helpLink: '帮助文档链接',
homeLink: '首页链接',

View File

@ -49,6 +49,14 @@
<el-button class="pwd-tips" type="text">{{ $t('system_parameter_setting.cas_reset') + '[/cas/reset/{adminAcount}/{adminPwd}]' }}</el-button>
</el-row>
<el-row>
<el-col>
<el-form-item :label="$t('display.openMarketPage')">
<el-checkbox v-model="formInline.openMarketPage" true-label="true" false-label="false" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item :label="$t('display.openHomePage')">
@ -163,8 +171,8 @@ export default {
{ paramKey: 'basic.frontTimeOut', paramValue: this.formInline.frontTimeOut, type: 'text', sort: 1 },
{ paramKey: 'basic.msgTimeOut', paramValue: this.formInline.msgTimeOut, type: 'text', sort: 2 },
{ paramKey: 'basic.loginType', paramValue: this.formInline.loginType, type: 'text', sort: 3 },
{ paramKey: 'ui.openHomePage', paramValue: this.formInline.openHomePage, type: 'text', sort: 13 }
{ paramKey: 'ui.openHomePage', paramValue: this.formInline.openHomePage, type: 'text', sort: 13 },
{ paramKey: 'ui.openMarketPage', paramValue: this.formInline.openMarketPage, type: 'text', sort: 14 }
]
this.$refs[formInline].validate(valid => {