This commit is contained in:
Qiuxia Fan 2022-03-21 18:29:46 +08:00
parent 206de21092
commit 601fa0e7bf
3 changed files with 9 additions and 8 deletions

View File

@ -46,9 +46,11 @@ const layer = ref<string>("GENERAL");
getDashboard();
async function getDashboard() {
setLayer(String(route.name));
dashboardStore.setLayer(layer.value);
dashboardStore.setEntity(EntityType[0].value);
dashboardStore.setMode(false);
dashboardStore.setCurrentDashboard(null);
setLayer(String(route.name));
await dashboardStore.setDashboards();
const index = dashboardStore.dashboards.findIndex(
(d: { name: string; isRoot: boolean; layer: string; entity: string }) =>
@ -97,8 +99,6 @@ function setLayer(n: string) {
layer.value = "GENERAL";
break;
}
dashboardStore.setLayer(layer.value);
dashboardStore.setEntity(EntityType[1].value);
}
watch(
() => route.name,

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<Tool v-if="dashboardStore.editMode" />
<Tool />
<div
class="ds-main"
@click="handleClick"

View File

@ -72,7 +72,7 @@ limitations under the License. -->
/>
</div>
</div>
<div class="tool-icons">
<div class="tool-icons" v-if="dashboardStore.editMode">
<span
@click="clickIcons(t)"
v-for="(t, index) in toolIcons"
@ -127,9 +127,10 @@ const states = reactive<{
currentDestService: "",
currentDestPod: "",
});
if (params.layerId) {
dashboardStore.setLayer(params.layerId);
dashboardStore.setEntity(params.entity);
}
appStore.setEventStack([initSelector]);
initSelector();