Merge pull request #6041 from dataease/pr@dev@feat_auto_mobile

feat: 自动识别移动端配置
This commit is contained in:
fit2cloud-chenyw 2023-09-06 21:24:09 +08:00 committed by GitHub
commit f364da727c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 44 additions and 3 deletions

View File

@ -116,7 +116,7 @@ public interface ParamConstants {
DS_CHECK_INTERVAL_TYPE("basic.dsCheckIntervalType"),
DEFAULT_LOGIN_TYPE("basic.loginType"),
OPEN_HOME_PAGE("ui.openHomePage"),
AUTO_MOBILE("ui.autoMobile"),
OPEN_MARKET_PAGE("ui.openMarketPage"),
TEMPLATE_MARKET_ULR("basic.templateMarketUlr"),

View File

@ -29,5 +29,7 @@ public class BasicInfo extends LoginLimitInfo implements Serializable {
private String dsCheckInterval;
@ApiModelProperty("数据源检测时间间隔类型")
private String dsCheckIntervalType;
@ApiModelProperty("自动识别移动端")
private String autoMobile = "true";
}

View File

@ -62,9 +62,11 @@ public class SystemParameterService {
List<SystemParameter> homePageList = this.getParamList("ui.openHomePage");
List<SystemParameter> marketPageList = this.getParamList("ui.openMarketPage");
List<SystemParameter> loginLimitList = this.getParamList("loginlimit");
List<SystemParameter> autoMobileList = this.getParamList("ui.autoMobile");
paramList.addAll(homePageList);
paramList.addAll(marketPageList);
paramList.addAll(loginLimitList);
paramList.addAll(autoMobileList);
BasicInfo result = new BasicInfo();
result.setOpenHomePage("true");
Map<String, LoginLimitXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class));
@ -92,6 +94,10 @@ public class SystemParameterService {
boolean open = StringUtils.equals("true", param.getParamValue());
result.setOpenMarketPage(open ? "true" : "false");
}
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.AUTO_MOBILE.getValue())) {
boolean close = StringUtils.equals("false", param.getParamValue());
result.setAutoMobile(close ? "false" : "true");
}
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.TEMPLATE_MARKET_ULR.getValue())) {
result.setTemplateMarketUlr(param.getParamValue());
}

View File

@ -165,6 +165,8 @@ import PDFPreExport from '@/views/panel/export/PDFPreExport'
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
import {hexColorToRGBA} from "@/views/chart/chart/util";
import { isMobile } from '@/utils/index'
const erd = elementResizeDetectorMaker()
export default {
@ -623,9 +625,8 @@ export default {
return -1
},
_isMobile() {
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
const flag = isMobile()
this.terminal = flag ? 'mobile' : 'pc'
// this.terminal = 'mobile'
},
canvasStyleDataInit() {
//

View File

@ -2412,6 +2412,7 @@ export default {
themeDark: 'Dark',
themeCustom: 'Custom',
openHomePage: 'Show Home Page',
auto_identify_mobile_devices: 'Automatically identify mobile devices',
openMarketPage: 'Show Market Page',
mobileBG: 'Mobile Login page BG',
helpLink: 'Help Document Link',

View File

@ -2406,6 +2406,7 @@ export default {
themeDark: '深色',
themeCustom: '自定義',
openHomePage: '顯示首頁',
auto_identify_mobile_devices: '自動識別移動設備',
openMarketPage: '顯示模板市場',
mobileBG: '移動端登錄頁背景',
helpLink: '幫助文檔鏈接',

View File

@ -2406,6 +2406,7 @@ export default {
themeDark: '深色',
themeCustom: '自定义',
openHomePage: '显示首页',
auto_identify_mobile_devices: '自动识别移动设备',
openMarketPage: '显示模板市场',
mobileBG: '移动端登录页背景',
helpLink: '帮助文档链接',

View File

@ -5,6 +5,7 @@ import { seizeLogin } from '@/api/user'
import router from '@/router'
import store from '@/store'
import { Loading } from 'element-ui'
import { getSysUI } from '@/utils/auth'
export function timeSection(date, type, labelFormat = 'yyyy-MM-dd') {
if (!date) {
return null
@ -308,6 +309,10 @@ export function getQueryVariable(variable) {
}
export function isMobile() {
const uiInfo = getSysUI()
if (uiInfo['ui.autoMobile']?.paramValue === 'false') {
return false
}
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
return flag
}

View File

@ -207,6 +207,24 @@
>{{ $t("commons.no") }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
:label="
$t('commons.yes') + $t('commons.no') + $t('display.auto_identify_mobile_devices')
"
prop="autoMobile"
>
<el-radio-group v-model="formInline.autoMobile">
<el-radio
label="true"
size="mini"
>{{ $t("commons.yes") }}</el-radio>
<el-radio
label="false"
size="mini"
>{{ $t("commons.no") }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
</template>
@ -412,6 +430,12 @@ export default {
type: 'text',
sort: 14
},
{
paramKey: 'ui.autoMobile',
paramValue: this.formInline.autoMobile,
type: 'text',
sort: 15
},
{
paramKey: 'loginlimit.limitTimes',