Skip to content

Commit

Permalink
bugfix: 体验问题修复 TencentBlueKing#1461
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Nov 17, 2022
1 parent 8645112 commit 3a3e10f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/frontend/package.json
Expand Up @@ -19,7 +19,7 @@
"@vue/composition-api": "^1.5.0",
"ace-builds": "^1.13.0",
"axios": "^0.27.2",
"bk-magic-vue": "2.5.3-beta.4",
"bk-magic-vue": "2.5.3-beta.5",
"core-js": "^3.26.1",
"cron-parser-custom": "^2.13.0",
"diff": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/components/ip-selector/entry.vue
Expand Up @@ -187,8 +187,8 @@
refresh () {
viewsRef.value && viewsRef.value.refresh();
},
collapseToggle () {
viewsRef.value && viewsRef.value.collapseToggle();
collapseToggle (toggle) {
viewsRef.value && viewsRef.value.collapseToggle(toggle);
},
});
</script>
Expand Down
Expand Up @@ -24,7 +24,13 @@
<script setup>
import { ref } from 'vue';
import IpSelectorIcon from '../../../common/ip-selector-icon';
import IpSelectorIcon from '../../common/ip-selector-icon';
const props = defineProps({
name: {
type: String,
},
});
const isShow = ref(true);
Expand All @@ -33,8 +39,16 @@
};
defineExpose({
toggle () {
handleToggle();
toggle (lastStatus) {
if (lastStatus === undefined) {
handleToggle();
} else if (lastStatus === false) {
isShow.value = false;
} else if (lastStatus === true) {
isShow.value = true;
} else if (Array.isArray(lastStatus) && props.name && lastStatus.includes(props.name)) {
isShow.value = true;
}
},
});
</script>
Expand Down
Expand Up @@ -88,7 +88,7 @@
groupHostList,
} from '../../utils';
import CollapseBox from './collapse-box/index.vue';
import CollapseBox from './collapse-box.vue';
const props = defineProps({
data: {
Expand Down Expand Up @@ -175,7 +175,7 @@
isInnerChange = false;
return;
}
if (props.data.length > 0) {
fetchData();
} else {
Expand Down Expand Up @@ -238,7 +238,7 @@
};
</script>
<style lang="postcss">
@import "../../styles/table.mixin.css";
@import url("../../styles/table.mixin.css");
.ip-selector-view-host {
@include table;
Expand Down
Expand Up @@ -2,7 +2,9 @@
<div
v-bkloading="{ isLoading }"
class="ip-selector-view-dynamic-group">
<collapse-box ref="collapseBoxRef">
<collapse-box
ref="collapseBoxRef"
name="dynamicGroup">
<template #title>
<span style="font-weight: bold;">【动态分组】</span>
<span>
Expand Down Expand Up @@ -113,7 +115,7 @@
} from '../utils';
import RenderAgentStatistics from './components/agent-statistics.vue';
import CollapseBox from './components/collapse-box/index.vue';
import CollapseBox from './components/collapse-box.vue';
import HostList from './components/dynamic-group-host-list.vue';
const props = defineProps({
Expand Down Expand Up @@ -266,8 +268,8 @@
refresh () {
fetchData();
},
collapseToggle () {
collapseBoxRef.value.toggle();
collapseToggle (toggle) {
collapseBoxRef.value.toggle(toggle);
},
});
</script>
Expand Down
10 changes: 6 additions & 4 deletions src/frontend/src/components/ip-selector/views-box/host.vue
Expand Up @@ -2,7 +2,9 @@
<div
v-bkloading="{ isLoading }"
class="ip-selector-view-host">
<collapse-box ref="collapseBoxRef">
<collapse-box
ref="collapseBoxRef"
name="host">
<template #title>
<span style="font-weight: bold;">【静态拓扑】</span>
<span>
Expand Down Expand Up @@ -95,7 +97,7 @@
isAliveHost,
} from '../utils';
import CollapseBox from './components/collapse-box/index.vue';
import CollapseBox from './components/collapse-box.vue';
const props = defineProps({
data: {
Expand Down Expand Up @@ -292,8 +294,8 @@
refresh () {
fetchData();
},
collapseToggle () {
collapseBoxRef.value.toggle();
collapseToggle (toggle) {
collapseBoxRef.value.toggle(toggle);
},
});
</script>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/src/components/ip-selector/views-box/index.vue
Expand Up @@ -136,10 +136,10 @@
nodeRef.value && nodeRef.value.refresh();
dynamicGroupRef.value && dynamicGroupRef.value.refresh();
},
collapseToggle () {
hostRef.value && hostRef.value.collapseToggle();
nodeRef.value && nodeRef.value.collapseToggle();
dynamicGroupRef.value && dynamicGroupRef.value.collapseToggle();
collapseToggle (toggle) {
hostRef.value && hostRef.value.collapseToggle(toggle);
nodeRef.value && nodeRef.value.collapseToggle(toggle);
dynamicGroupRef.value && dynamicGroupRef.value.collapseToggle(toggle);
},
});
</script>
Expand Down
10 changes: 6 additions & 4 deletions src/frontend/src/components/ip-selector/views-box/node.vue
Expand Up @@ -2,7 +2,9 @@
<div
v-bkloading="{ isLoading }"
class="ip-selector-view-node">
<collapse-box ref="collapseBoxRef">
<collapse-box
ref="collapseBoxRef"
name="node">
<template #title>
<span style="font-weight: bold;">【动态拓扑】</span>
<span>
Expand Down Expand Up @@ -114,7 +116,7 @@
} from '../utils';
import RenderAgentStatistics from './components/agent-statistics.vue';
import CollapseBox from './components/collapse-box/index.vue';
import CollapseBox from './components/collapse-box.vue';
import NodeHostList from './components/node-host-list.vue';
const props = defineProps({
Expand Down Expand Up @@ -288,8 +290,8 @@
refresh () {
fetchData();
},
collapseToggle () {
collapseBoxRef.value.toggle();
collapseToggle (toggle) {
collapseBoxRef.value.toggle(toggle);
},
});
</script>
Expand Down

0 comments on commit 3a3e10f

Please sign in to comment.