fix: BUG修改
This commit is contained in:
parent
5ee673b2fa
commit
fd815634a8
@ -21,12 +21,21 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Card from "@/components/card.vue";
|
||||
import { reactive, onMounted, ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { getWeatherDataApi } from "@/api/modules/headNoise";
|
||||
import { getProjectDetail } from "@/api/modules/projectOverview";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const store = GlobalStore();
|
||||
const weatherList = ref([]);
|
||||
const projectData = ref(null as any);
|
||||
//获取项目信息
|
||||
const getProjectInfo = async () => {
|
||||
const res = await getProjectDetail({ projectSn: store.sn });
|
||||
projectData.value = res.result;
|
||||
};
|
||||
//获取天气
|
||||
const loadWeather = async () => {
|
||||
const res = await getWeatherDataApi({ cityid: "" });
|
||||
const res = await getWeatherDataApi({ areaId: projectData.value.areaCode || "" });
|
||||
let json = JSON.parse(res.result);
|
||||
let list = json;
|
||||
console.log("获取天气", res.result);
|
||||
@ -40,8 +49,9 @@ const loadWeather = async () => {
|
||||
weatherList.value.push(element);
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
loadWeather();
|
||||
onMounted(async () => {
|
||||
await getProjectInfo();
|
||||
await loadWeather();
|
||||
});
|
||||
const weatherIcon = ref([
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user