Skip to content

Commit

Permalink
修复模型过多时加载页面卡顿,修改低分辨率界面的缩放率
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyuxiaoxiao committed Oct 31, 2023
1 parent 8262460 commit 1aa43f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
</a-config-provider>
<a-layout style="min-height: 100vh">
<a-layout-sider theme="light" width="20%" v-model:collapsed="collapsed.value" collapsible >
<a-layout-sider theme="light" width="20%" v-model:collapsed="collapsed" collapsible >
<div class="logo"/>
<a-menu v-model:selectedKeys="selectedKeys" mode="inline">
<a-menu-item key="1">
Expand Down Expand Up @@ -49,7 +49,7 @@ export default defineComponent({
data() {
return {
selectedKeys: ['1'],
collapsed: false
collapsed: true
}
},
components: {infer}
Expand Down
9 changes: 5 additions & 4 deletions src/components/select_model.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ export default {
</a-space-compact>

</a-col>
<a-col :span="18">
<a-col :span="14">
<a-tree-select
v-model:value="selected_models"
style="width: 100%"
:virtual="false"
:on-click="get_local_models"
:tree-data="treeData"
tree-checkable
Expand All @@ -138,7 +139,7 @@ export default {
list-height="512"
/>
</a-col>
<a-col :span="2">
<a-col :span="4">
<a-select
ref="select"
v-model:value="device"
Expand All @@ -148,7 +149,7 @@ export default {
<a-select-option v-for="dev in devices" :value="dev"></a-select-option>
</a-select>
</a-col>
<a-col :span="2">
<a-col :span="3">
<a-select
ref="select"
v-model:value="language"
Expand All @@ -160,7 +161,7 @@ export default {
<a-select-option value="EN"></a-select-option>
</a-select>
</a-col>
<a-col :span="2">
<a-col :span="3">
<a-button type="primary" @click="load_all_models" :loading="model_loading">加载模型</a-button>
</a-col>
</a-row>
Expand Down
10 changes: 9 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import { createApp } from 'vue'
import {createApp} from 'vue'
import Window from './Window.vue'


const viewportWidth = window.innerWidth;
if (2560 < viewportWidth && viewportWidth < 3840) {
document.body.style.zoom = "85%";
}
else if(viewportWidth<2560){
document.body.style.zoom = "75%";
}


const app = createApp(Window)

Expand Down

0 comments on commit 1aa43f7

Please sign in to comment.