forked from github/dataease
Merge pull request #6041 from dataease/pr@dev@feat_auto_mobile
feat: 自动识别移动端配置
This commit is contained in:
commit
f364da727c
@ -116,7 +116,7 @@ public interface ParamConstants {
|
|||||||
DS_CHECK_INTERVAL_TYPE("basic.dsCheckIntervalType"),
|
DS_CHECK_INTERVAL_TYPE("basic.dsCheckIntervalType"),
|
||||||
DEFAULT_LOGIN_TYPE("basic.loginType"),
|
DEFAULT_LOGIN_TYPE("basic.loginType"),
|
||||||
OPEN_HOME_PAGE("ui.openHomePage"),
|
OPEN_HOME_PAGE("ui.openHomePage"),
|
||||||
|
AUTO_MOBILE("ui.autoMobile"),
|
||||||
OPEN_MARKET_PAGE("ui.openMarketPage"),
|
OPEN_MARKET_PAGE("ui.openMarketPage"),
|
||||||
TEMPLATE_MARKET_ULR("basic.templateMarketUlr"),
|
TEMPLATE_MARKET_ULR("basic.templateMarketUlr"),
|
||||||
|
|
||||||
|
@ -29,5 +29,7 @@ public class BasicInfo extends LoginLimitInfo implements Serializable {
|
|||||||
private String dsCheckInterval;
|
private String dsCheckInterval;
|
||||||
@ApiModelProperty("数据源检测时间间隔类型")
|
@ApiModelProperty("数据源检测时间间隔类型")
|
||||||
private String dsCheckIntervalType;
|
private String dsCheckIntervalType;
|
||||||
|
@ApiModelProperty("自动识别移动端")
|
||||||
|
private String autoMobile = "true";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,9 +62,11 @@ public class SystemParameterService {
|
|||||||
List<SystemParameter> homePageList = this.getParamList("ui.openHomePage");
|
List<SystemParameter> homePageList = this.getParamList("ui.openHomePage");
|
||||||
List<SystemParameter> marketPageList = this.getParamList("ui.openMarketPage");
|
List<SystemParameter> marketPageList = this.getParamList("ui.openMarketPage");
|
||||||
List<SystemParameter> loginLimitList = this.getParamList("loginlimit");
|
List<SystemParameter> loginLimitList = this.getParamList("loginlimit");
|
||||||
|
List<SystemParameter> autoMobileList = this.getParamList("ui.autoMobile");
|
||||||
paramList.addAll(homePageList);
|
paramList.addAll(homePageList);
|
||||||
paramList.addAll(marketPageList);
|
paramList.addAll(marketPageList);
|
||||||
paramList.addAll(loginLimitList);
|
paramList.addAll(loginLimitList);
|
||||||
|
paramList.addAll(autoMobileList);
|
||||||
BasicInfo result = new BasicInfo();
|
BasicInfo result = new BasicInfo();
|
||||||
result.setOpenHomePage("true");
|
result.setOpenHomePage("true");
|
||||||
Map<String, LoginLimitXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class));
|
Map<String, LoginLimitXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((LoginLimitXpackService.class));
|
||||||
@ -92,6 +94,10 @@ public class SystemParameterService {
|
|||||||
boolean open = StringUtils.equals("true", param.getParamValue());
|
boolean open = StringUtils.equals("true", param.getParamValue());
|
||||||
result.setOpenMarketPage(open ? "true" : "false");
|
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())) {
|
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.TEMPLATE_MARKET_ULR.getValue())) {
|
||||||
result.setTemplateMarketUlr(param.getParamValue());
|
result.setTemplateMarketUlr(param.getParamValue());
|
||||||
}
|
}
|
||||||
|
@ -165,6 +165,8 @@ import PDFPreExport from '@/views/panel/export/PDFPreExport'
|
|||||||
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
|
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
|
||||||
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
|
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
|
||||||
import {hexColorToRGBA} from "@/views/chart/chart/util";
|
import {hexColorToRGBA} from "@/views/chart/chart/util";
|
||||||
|
import { isMobile } from '@/utils/index'
|
||||||
|
|
||||||
|
|
||||||
const erd = elementResizeDetectorMaker()
|
const erd = elementResizeDetectorMaker()
|
||||||
export default {
|
export default {
|
||||||
@ -623,9 +625,8 @@ export default {
|
|||||||
return -1
|
return -1
|
||||||
},
|
},
|
||||||
_isMobile() {
|
_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 = flag ? 'mobile' : 'pc'
|
||||||
// this.terminal = 'mobile'
|
|
||||||
},
|
},
|
||||||
canvasStyleDataInit() {
|
canvasStyleDataInit() {
|
||||||
// 数据刷新计时器
|
// 数据刷新计时器
|
||||||
|
@ -2412,6 +2412,7 @@ export default {
|
|||||||
themeDark: 'Dark',
|
themeDark: 'Dark',
|
||||||
themeCustom: 'Custom',
|
themeCustom: 'Custom',
|
||||||
openHomePage: 'Show Home Page',
|
openHomePage: 'Show Home Page',
|
||||||
|
auto_identify_mobile_devices: 'Automatically identify mobile devices',
|
||||||
openMarketPage: 'Show Market Page',
|
openMarketPage: 'Show Market Page',
|
||||||
mobileBG: 'Mobile Login page BG',
|
mobileBG: 'Mobile Login page BG',
|
||||||
helpLink: 'Help Document Link',
|
helpLink: 'Help Document Link',
|
||||||
|
@ -2406,6 +2406,7 @@ export default {
|
|||||||
themeDark: '深色',
|
themeDark: '深色',
|
||||||
themeCustom: '自定義',
|
themeCustom: '自定義',
|
||||||
openHomePage: '顯示首頁',
|
openHomePage: '顯示首頁',
|
||||||
|
auto_identify_mobile_devices: '自動識別移動設備',
|
||||||
openMarketPage: '顯示模板市場',
|
openMarketPage: '顯示模板市場',
|
||||||
mobileBG: '移動端登錄頁背景',
|
mobileBG: '移動端登錄頁背景',
|
||||||
helpLink: '幫助文檔鏈接',
|
helpLink: '幫助文檔鏈接',
|
||||||
|
@ -2406,6 +2406,7 @@ export default {
|
|||||||
themeDark: '深色',
|
themeDark: '深色',
|
||||||
themeCustom: '自定义',
|
themeCustom: '自定义',
|
||||||
openHomePage: '显示首页',
|
openHomePage: '显示首页',
|
||||||
|
auto_identify_mobile_devices: '自动识别移动设备',
|
||||||
openMarketPage: '显示模板市场',
|
openMarketPage: '显示模板市场',
|
||||||
mobileBG: '移动端登录页背景',
|
mobileBG: '移动端登录页背景',
|
||||||
helpLink: '帮助文档链接',
|
helpLink: '帮助文档链接',
|
||||||
|
@ -5,6 +5,7 @@ import { seizeLogin } from '@/api/user'
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { Loading } from 'element-ui'
|
import { Loading } from 'element-ui'
|
||||||
|
import { getSysUI } from '@/utils/auth'
|
||||||
export function timeSection(date, type, labelFormat = 'yyyy-MM-dd') {
|
export function timeSection(date, type, labelFormat = 'yyyy-MM-dd') {
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return null
|
return null
|
||||||
@ -308,6 +309,10 @@ export function getQueryVariable(variable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isMobile() {
|
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)
|
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
|
return flag
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,24 @@
|
|||||||
>{{ $t("commons.no") }}</el-radio>
|
>{{ $t("commons.no") }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -412,6 +430,12 @@ export default {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
sort: 14
|
sort: 14
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
paramKey: 'ui.autoMobile',
|
||||||
|
paramValue: this.formInline.autoMobile,
|
||||||
|
type: 'text',
|
||||||
|
sort: 15
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
paramKey: 'loginlimit.limitTimes',
|
paramKey: 'loginlimit.limitTimes',
|
||||||
|
Loading…
Reference in New Issue
Block a user