fix: warnings

This commit is contained in:
Qiuxia Fan 2022-02-17 20:50:12 +08:00
parent 6bccb79eaf
commit 69a148b599
6 changed files with 19 additions and 17 deletions

View File

@ -20,6 +20,7 @@ import { watch, ref, Ref, onMounted, onBeforeUnmount, unref } from "vue";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useECharts } from "@/hooks/useEcharts"; import { useECharts } from "@/hooks/useEcharts";
import { addResizeListener, removeResizeListener } from "@/utils/event"; import { addResizeListener, removeResizeListener } from "@/utils/event";
import { useTimeoutFn } from "@/hooks/useTimeout";
/*global Nullable, defineProps, defineEmits*/ /*global Nullable, defineProps, defineEmits*/
const emits = defineEmits(["select"]); const emits = defineEmits(["select"]);
@ -36,14 +37,16 @@ const props = defineProps({
}, },
}); });
onMounted(() => { onMounted(async () => {
setOptions(props.option); await setOptions(props.option);
const instance = getInstance();
instance.on("click", (params: any) => {
emits("select", params);
});
addResizeListener(unref(chartRef), resize); addResizeListener(unref(chartRef), resize);
useTimeoutFn(() => {
const instance = getInstance();
instance.on("click", (params: any) => {
emits("select", params);
});
}, 1000);
}); });
watch( watch(

View File

@ -145,6 +145,7 @@ limitations under the License. -->
import { ref, computed, onMounted, onBeforeUnmount, watch } from "vue"; import { ref, computed, onMounted, onBeforeUnmount, watch } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import DateCalendar from "./DateCalendar.vue"; import DateCalendar from "./DateCalendar.vue";
import { useTimeoutFn } from "@/hooks/useTimeout";
/*global defineProps, defineEmits */ /*global defineProps, defineEmits */
const datepicker = ref(null); const datepicker = ref(null);
const { t } = useI18n(); const { t } = useI18n();
@ -270,9 +271,9 @@ const ok = (leaveOpened: boolean) => {
emit("input", get()); emit("input", get());
!leaveOpened && !leaveOpened &&
!props.showButtons && !props.showButtons &&
setTimeout(() => { useTimeoutFn(() => {
show.value = range.value; show.value = range.value;
}); }, 1);
}; };
const setDates = (d: Date) => { const setDates = (d: Date) => {
dates.value[1] = d; dates.value[1] = d;

View File

@ -86,6 +86,7 @@ const msg = {
nodeSettings: "Node Settings", nodeSettings: "Node Settings",
conditions: "Conditions", conditions: "Conditions",
legendSettings: "Legend Settings", legendSettings: "Legend Settings",
setLegend: "Set Legend",
hourTip: "Select Hour", hourTip: "Select Hour",
minuteTip: "Select Minute", minuteTip: "Select Minute",
secondTip: "Select Second", secondTip: "Select Second",

View File

@ -85,6 +85,7 @@ const msg = {
nodeSettings: "拓扑点设置", nodeSettings: "拓扑点设置",
conditions: "条件", conditions: "条件",
legendSettings: "图例设置", legendSettings: "图例设置",
setLegend: "设置图例",
hourTip: "选择小时", hourTip: "选择小时",
minuteTip: "选择分钟", minuteTip: "选择分钟",
secondTip: "选择秒数", secondTip: "选择秒数",

View File

@ -26,6 +26,7 @@ import { routesEvent } from "./event";
import { routesAlert } from "./alert"; import { routesAlert } from "./alert";
import { routesSetting } from "./setting"; import { routesSetting } from "./setting";
import { routesAlarm } from "./alarm"; import { routesAlarm } from "./alarm";
import { useTimeoutFn } from "@/hooks/useTimeout";
const routes: Array<RouteRecordRaw> = [ const routes: Array<RouteRecordRaw> = [
...routesGen, ...routesGen,
@ -51,7 +52,7 @@ router.beforeEach((to, from, next) => {
// const token = window.localStorage.getItem("skywalking-authority"); // const token = window.localStorage.getItem("skywalking-authority");
if ((window as any).axiosCancel.length !== 0) { if ((window as any).axiosCancel.length !== 0) {
for (const func of (window as any).axiosCancel) { for (const func of (window as any).axiosCancel) {
setTimeout(func(), 0); useTimeoutFn(func(), 0);
} }
(window as any).axiosCancel = []; (window as any).axiosCancel = [];
} }

View File

@ -160,7 +160,7 @@ limitations under the License. -->
size="small" size="small"
type="primary" type="primary"
> >
set legend {{ t("setLegend") }}
</el-button> </el-button>
</div> </div>
</template> </template>
@ -170,12 +170,7 @@ import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useTopologyStore } from "@/store/modules/topology"; import { useTopologyStore } from "@/store/modules/topology";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { import { MetricCatalog, ScopeType, MetricConditions } from "../../../data";
MetricCatalog,
ScopeType,
MetricConditions,
LegendConditions,
} from "../../../data";
import { Option } from "@/types/app"; import { Option } from "@/types/app";
import { useQueryTopologyMetrics } from "@/hooks/useProcessor"; import { useQueryTopologyMetrics } from "@/hooks/useProcessor";
import { Node, Call } from "@/types/topology"; import { Node, Call } from "@/types/topology";