fix: update config

This commit is contained in:
Fine 2023-02-06 12:10:12 +08:00
parent e80774cf94
commit 5a353b814c
5 changed files with 17 additions and 7 deletions

View File

@ -15,11 +15,22 @@ limitations under the License. -->
<template> <template>
<router-view /> <router-view />
</template> </template>
<script lang="ts" setup>
import { useRoute } from "vue-router";
const route = useRoute();
setTimeout(() => {
if (route.name === "ViewWidget") {
(document.querySelector("#app") as any).style.minWidth = "120px";
} else {
(document.querySelector("#app") as any).style.minWidth = "1024px";
}
}, 500);
</script>
<style> <style>
#app { #app {
color: #2c3e50; color: #2c3e50;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
min-width: 1024px;
} }
</style> </style>

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="nav-bar flex-h"> <div class="nav-bar flex-h">
<div class="title">{{ appStore.pageTitle || t(pageName) }}</div> <div class="title">{{ route.name === "ViewWidget" ? "" : appStore.pageTitle || t(pageName) }}</div>
<div class="app-config"> <div class="app-config">
<span class="red" v-show="timeRange">{{ t("timeTips") }}</span> <span class="red" v-show="timeRange">{{ t("timeTips") }}</span>
<TimePicker <TimePicker

View File

@ -95,7 +95,7 @@ limitations under the License. -->
} else { } else {
appStore.setIsMobile(false); appStore.setIsMobile(false);
} }
if (route.params.config) { if (route.name === "ViewWidget") {
showMenu.value = false; showMenu.value = false;
} }
const controlMenu = () => { const controlMenu = () => {

View File

@ -24,7 +24,7 @@ limitations under the License. -->
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<div class="widget-chart" :style="{ height: config.height + 'px' }"> <div class="widget-chart" :style="{ height: config.height - 60 + 'px' }">
<component <component
:is="graph.type" :is="graph.type"
:intervalTime="appStoreWithOut.intervalTime" :intervalTime="appStoreWithOut.intervalTime"
@ -75,7 +75,6 @@ limitations under the License. -->
init(); init();
async function init() { async function init() {
appStoreWithOut.setPageTitle("Widget");
dashboardStore.setLayer(route.params.layer); dashboardStore.setLayer(route.params.layer);
dashboardStore.setEntity(route.params.entity); dashboardStore.setEntity(route.params.entity);
await setSelector(); await setSelector();
@ -152,7 +151,7 @@ limitations under the License. -->
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
min-width: 800px; min-width: 100px;
border: 1px solid #eee; border: 1px solid #eee;
background-color: #fff; background-color: #fff;
position: relative; position: relative;

View File

@ -95,7 +95,7 @@ limitations under the License. -->
metrics: dashboardStore.selectedGrid.metrics, metrics: dashboardStore.selectedGrid.metrics,
metricTypes: dashboardStore.selectedGrid.metricTypes, metricTypes: dashboardStore.selectedGrid.metricTypes,
metricConfig: metricConfig, metricConfig: metricConfig,
height: dashboardStore.selectedGrid.h * 20, height: dashboardStore.selectedGrid.h * 20 + 60,
}); });
const path = `/page/${dashboardStore.layerId}/${ const path = `/page/${dashboardStore.layerId}/${
dashboardStore.entity dashboardStore.entity