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