fix: update style

This commit is contained in:
Qiuxia Fan 2022-02-16 17:45:21 +08:00
parent 57e6fc342d
commit 4ad5962fcc
4 changed files with 11 additions and 26 deletions

View File

@ -37,11 +37,12 @@ const props = defineProps({
}); });
onMounted(() => { onMounted(() => {
setOptions(props.option);
const instance = getInstance(); const instance = getInstance();
instance.on("click", (params: any) => { instance.on("click", (params: any) => {
emits("select", params); emits("select", params);
}); });
setOptions(props.option);
addResizeListener(unref(chartRef), resize); addResizeListener(unref(chartRef), resize);
}); });

View File

@ -152,7 +152,6 @@ export default defineComponent({
if (dashboardStore.entity === EntityType[0].value) { if (dashboardStore.entity === EntityType[0].value) {
return; return;
} }
console.log("enter");
queryMetrics(); queryMetrics();
} }
); );

View File

@ -403,7 +403,7 @@ function updateSettings(config: any) {
if (config.nodeDashboard) { if (config.nodeDashboard) {
items.value.push({ items.value.push({
id: "dashboard", id: "dashboard",
title: "Dashboard", title: "View Dashboard",
func: handleGoDashboard, func: handleGoDashboard,
}); });
} }
@ -455,7 +455,7 @@ onBeforeUnmount(() => {
span { span {
display: block; display: block;
height: 30px; height: 30px;
width: 100px; width: 140px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
} }
@ -505,27 +505,6 @@ onBeforeUnmount(() => {
font-size: 11px; font-size: 11px;
opacity: 0.8; opacity: 0.8;
} }
.topo-tool {
display: none;
}
.topo-tool-i {
cursor: pointer;
.tool-hexagon {
fill: #3f4450;
stroke: #217ef2;
stroke-width: 2;
stroke-opacity: 0.5;
}
&:hover {
.tool-hexagon {
stroke-opacity: 1;
}
}
}
} }
.d3-tip { .d3-tip {

View File

@ -42,6 +42,7 @@ limitations under the License. -->
class="sankey" class="sankey"
:style="`height:${height}px;width:${width}px;`" :style="`height:${height}px;width:${width}px;`"
v-loading="loading" v-loading="loading"
@click="handleClick"
> >
<Sankey @click="selectNodeLink" /> <Sankey @click="selectNodeLink" />
</div> </div>
@ -153,7 +154,6 @@ function backToTopology() {
function selectNodeLink(d: any) { function selectNodeLink(d: any) {
if (d.dataType === "edge") { if (d.dataType === "edge") {
console.log(d.data);
topologyStore.setNode(null); topologyStore.setNode(null);
topologyStore.setLink(d.data); topologyStore.setLink(d.data);
if (!settings.value.linkDashboard) { if (!settings.value.linkDashboard) {
@ -195,6 +195,12 @@ async function getTopology(id: string) {
} }
return resp; return resp;
} }
function handleClick(event: any) {
if (event.target.nodeName === "svg") {
topologyStore.setNode(null);
topologyStore.setLink(null);
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sankey { .sankey {