UPDATE: 优化客户端桌面窗口内容自适应
This commit is contained in:
@@ -25,10 +25,10 @@ module.exports = (appInfo) => {
|
|||||||
*/
|
*/
|
||||||
config.windowsOption = {
|
config.windowsOption = {
|
||||||
title: '自动检测平台',
|
title: '自动检测平台',
|
||||||
width: 1600,
|
width: 1920 /1.5,
|
||||||
height: 950,
|
height: 1080 /1.2,
|
||||||
minWidth: 1600,
|
minWidth: 1920 /1.5,
|
||||||
minHeight: 950,
|
minHeight: 1080 /1.2,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
//webSecurity: false,
|
//webSecurity: false,
|
||||||
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
|
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module.exports = (appInfo) => {
|
|||||||
/**
|
/**
|
||||||
* 开发者工具
|
* 开发者工具
|
||||||
*/
|
*/
|
||||||
config.openDevTools = true;
|
config.openDevTools = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用程序顶部菜单
|
* 应用程序顶部菜单
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"@types/event-source-polyfill": "^1.0.5",
|
"@types/event-source-polyfill": "^1.0.5",
|
||||||
"@vue-flow/core": "^1.45.0",
|
"@vue-flow/core": "^1.45.0",
|
||||||
"@vueuse/core": "^10.4.1",
|
"@vueuse/core": "^10.4.1",
|
||||||
|
"autofit.js": "^3.2.8",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.9",
|
"dayjs": "^1.11.9",
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--element-plus语言国际化,全局修改为中文-->
|
<!--element-plus语言国际化,全局修改为中文-->
|
||||||
<el-config-provider
|
<el-config-provider :locale="locale" :size="assemblySize" :button="buttonConfig">
|
||||||
:locale='locale'
|
<router-view />
|
||||||
:size='assemblySize'
|
</el-config-provider>
|
||||||
:button='buttonConfig'
|
|
||||||
>
|
|
||||||
<router-view />
|
|
||||||
</el-config-provider>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang="ts" setup>
|
||||||
defineOptions({
|
import autofit from 'autofit.js'
|
||||||
name: 'App',
|
|
||||||
})
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { getBrowserLang } from '@/utils'
|
import { getBrowserLang } from '@/utils'
|
||||||
import { useTheme } from '@/hooks/useTheme'
|
import { useTheme } from '@/hooks/useTheme'
|
||||||
import { ElConfigProvider } from 'element-plus'
|
import { ElConfigProvider } from 'element-plus'
|
||||||
import { LanguageType } from './stores/interface'
|
import { type LanguageType } from './stores/interface'
|
||||||
import { useGlobalStore } from '@/stores/modules/global'
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import en from 'element-plus/es/locale/lang/en'
|
import en from 'element-plus/es/locale/lang/en'
|
||||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'App'
|
||||||
|
})
|
||||||
|
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
// init theme
|
// init theme
|
||||||
@@ -31,16 +29,26 @@ initTheme()
|
|||||||
// init language
|
// init language
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const language = globalStore.language ?? getBrowserLang()
|
const language = globalStore.language ?? getBrowserLang()
|
||||||
i18n.locale.value = language
|
i18n.locale.value = language
|
||||||
globalStore.setGlobalState('language', language as LanguageType)
|
globalStore.setGlobalState('language', language as LanguageType)
|
||||||
|
// 自动适配
|
||||||
|
autofit.init({
|
||||||
|
el: '#app',
|
||||||
|
//dh: 720 * 1,
|
||||||
|
//dw: 1280 * 1.2,
|
||||||
|
dw: 1920 / 1.5,
|
||||||
|
dh: 1080 / 1.2,
|
||||||
|
resize: true,
|
||||||
|
limit: 0.1
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// element language
|
// element language
|
||||||
const locale = computed(() => {
|
const locale = computed(() => {
|
||||||
if (globalStore.language == 'zh') return zhCn
|
if (globalStore.language == 'zh') return zhCn
|
||||||
if (globalStore.language == 'en') return en
|
if (globalStore.language == 'en') return en
|
||||||
return getBrowserLang() == 'zh' ? zhCn : en
|
return getBrowserLang() == 'zh' ? zhCn : en
|
||||||
})
|
})
|
||||||
|
|
||||||
// element assemblySize
|
// element assemblySize
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user