mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 修复未知dom大小,调整UI
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<v-chart :option="getPoolData()" autoresize />
|
||||
<div class="gro-echart">
|
||||
<v-chart :option="getPoolData()" autoresize />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { EChartsOption } from "echarts";
|
||||
@@ -13,10 +15,9 @@ import {
|
||||
import { use } from "echarts/core";
|
||||
import { LabelLayout } from "echarts/features";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
import { onMounted, provide } from "vue";
|
||||
import { provide } from "vue";
|
||||
import VChart, { THEME_KEY } from "vue-echarts";
|
||||
|
||||
import showSnackbar from "../func/snackbar.js";
|
||||
// echarts
|
||||
|
||||
use([
|
||||
@@ -37,13 +38,6 @@ interface GachaOverviewEchartsProps {
|
||||
|
||||
const props = defineProps<GachaOverviewEchartsProps>();
|
||||
|
||||
onMounted(async () => {
|
||||
const totalNum = props.modelValue.length;
|
||||
showSnackbar({
|
||||
text: `成功获取 ${totalNum} 条祈愿数据`,
|
||||
});
|
||||
});
|
||||
|
||||
// data
|
||||
const defaultOptions = <EChartsOption>{
|
||||
title: [
|
||||
@@ -213,3 +207,12 @@ function getPoolData(): EChartsOption {
|
||||
return data;
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.gro-echart {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -155,12 +155,13 @@ function getBox(id: number): TItemBoxData {
|
||||
display: "inner",
|
||||
clickable: true,
|
||||
lt: `/icon/element/${cFind.element}元素.webp`,
|
||||
ltSize: "30px",
|
||||
ltSize: "20px",
|
||||
innerHeight: 20,
|
||||
innerIcon: `/icon/weapon/${cFind.weapon}.webp`,
|
||||
innerText: cFind.name,
|
||||
};
|
||||
} else if (wFind) {
|
||||
}
|
||||
if (wFind) {
|
||||
return {
|
||||
bg: `/icon/bg/${wFind.star}-Star.webp`,
|
||||
icon: `/WIKI/weapon/${wFind.id}.webp`,
|
||||
@@ -169,13 +170,23 @@ function getBox(id: number): TItemBoxData {
|
||||
display: "inner",
|
||||
clickable: true,
|
||||
lt: wFind.weaponIcon,
|
||||
ltSize: "30px",
|
||||
ltSize: "20px",
|
||||
innerHeight: 20,
|
||||
innerText: wFind.name,
|
||||
};
|
||||
} else {
|
||||
throw new Error("未找到对应角色或武器");
|
||||
}
|
||||
return {
|
||||
bg: "/icon/bg/0-Star.webp",
|
||||
icon: "/source/UI/empty/webp",
|
||||
size: "80px",
|
||||
height: "80px",
|
||||
display: "inner",
|
||||
clickable: false,
|
||||
lt: "",
|
||||
ltSize: "0",
|
||||
innerHeight: 20,
|
||||
innerText: "未找到对应角色或武器",
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
|
||||
Reference in New Issue
Block a user