Merge branch 'rongtu_dev' into rongtu_cjw

This commit is contained in:
Vce 2024-04-07 19:01:20 +08:00
commit 2e30e3afe0
4 changed files with 20 additions and 4 deletions

View File

@ -56,7 +56,7 @@ router.beforeEach(async (to, from, next) => {
console.log("判断是访问登陆页,有:", from.fullPath); console.log("判断是访问登陆页,有:", from.fullPath);
console.log("判断是访问登陆页globalStore.token有:", globalStore.token); console.log("判断是访问登陆页globalStore.token有:", globalStore.token);
if (globalStore.token) return next(from.fullPath); if (globalStore.token && from.fullPath != '/') return next(from.fullPath);
// resetRouter();//重置路由 // resetRouter();//重置路由
return next(); return next();
} }

View File

@ -8,6 +8,11 @@ import { HOME_URL } from "@/enums/Home/index";
* staticRouter() * staticRouter()
*/ */
export const staticRouter: RouteRecordRaw[] = [ export const staticRouter: RouteRecordRaw[] = [
{
path: "/",
// redirect: HOME_URL[0]
redirect: LOGIN_URL
},
{ {
path: "/login", path: "/login",
name: "login", name: "login",

View File

@ -23,10 +23,21 @@
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { reactive, onMounted, ref } from "vue"; import { reactive, onMounted, ref } from "vue";
import { getWeatherDataApi } from "@/api/modules/headNoise"; import { getWeatherDataApi } from "@/api/modules/headNoise";
import { getTaskTimeDetail } from "@/api/modules/schedulePlan";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
const weatherList = ref([]); const weatherList = ref([]);
//
const projectTimeInfo = ref({} as any);
const getProjectInfo = async () => {
const res: any = await getTaskTimeDetail({ projectSn: store.sn });
console.log("获取项目信息", res);
projectTimeInfo.value = res.result;
loadWeather();
};
// //
const loadWeather = async () => { const loadWeather = async () => {
const res = await getWeatherDataApi({ cityid: "" }); const res = await getWeatherDataApi({ cityid: "", areaId: projectTimeInfo.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);
@ -41,7 +52,7 @@ const loadWeather = async () => {
}); });
}; };
onMounted(() => { onMounted(() => {
loadWeather(); getProjectInfo();
}); });
const weatherIcon = ref([ const weatherIcon = ref([
{ {

View File

@ -212,7 +212,7 @@
<el-carousel-item v-for="(item, index) in detailData.videoList" :key="item.id"> <el-carousel-item v-for="(item, index) in detailData.videoList" :key="item.id">
<div style="width: 100%; height: 100%"> <div style="width: 100%; height: 100%">
<ckplayerComp <ckplayerComp
:name="0" :name="index"
:poster="''" :poster="''"
:deviceIp="`http://${item.account}:${item.password}`" :deviceIp="`http://${item.account}:${item.password}`"
:videoUrls="item.serialNumber" :videoUrls="item.serialNumber"