2025-10-15 14:07:39 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="home">
|
2025-10-16 15:04:54 +08:00
|
|
|
<van-nav-bar title="愉快政" fixed left-arrow />
|
|
|
|
|
|
|
|
|
|
<van-cell-group>
|
2025-11-04 17:29:45 +08:00
|
|
|
<van-cell title="当前站点" :value="detailData.mc" />
|
2025-10-16 15:04:54 +08:00
|
|
|
</van-cell-group>
|
2025-10-15 14:07:39 +08:00
|
|
|
|
|
|
|
|
<div class="content">
|
2025-10-16 15:04:54 +08:00
|
|
|
<van-grid :gutter="10" :column-num="3" class="grid">
|
2025-11-04 17:29:45 +08:00
|
|
|
<van-grid-item
|
|
|
|
|
icon="setting-o"
|
|
|
|
|
text="设备管理"
|
|
|
|
|
:to="{
|
|
|
|
|
name: 'EquipManage',
|
|
|
|
|
params: { data: encodeURIComponent(JSON.stringify(detailData)) },
|
|
|
|
|
}"
|
|
|
|
|
/>
|
2025-11-04 15:17:12 +08:00
|
|
|
<van-grid-item icon="setting-o" text="物资管理" to="/MaterialManage" />
|
|
|
|
|
<van-grid-item icon="setting-o" text="人员管理" to="/StaffManage" />
|
|
|
|
|
<van-grid-item icon="setting-o" text="冰雪灾害" to="/IceHail" />
|
2025-10-15 14:07:39 +08:00
|
|
|
</van-grid>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-10-16 15:04:54 +08:00
|
|
|
<!-- <van-tabbar v-model="active" route>
|
2025-10-15 14:07:39 +08:00
|
|
|
<van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
|
|
|
|
|
<van-tabbar-item icon="user-o" to="/user">我的</van-tabbar-item>
|
2025-10-16 15:04:54 +08:00
|
|
|
</van-tabbar> -->
|
2025-10-15 14:07:39 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-11-04 17:29:45 +08:00
|
|
|
import { ref, onMounted } from "vue";
|
2025-10-16 15:04:54 +08:00
|
|
|
import { useRouter } from "vue-router";
|
|
|
|
|
import { showToast } from "vant";
|
2025-11-04 15:17:12 +08:00
|
|
|
import { request } from "../../../shared/utils/request";
|
2025-10-15 14:07:39 +08:00
|
|
|
|
2025-10-16 15:04:54 +08:00
|
|
|
const router = useRouter();
|
|
|
|
|
const active = ref(0);
|
2025-11-04 17:29:45 +08:00
|
|
|
const detailData = ref({});
|
2025-10-15 14:07:39 +08:00
|
|
|
|
2025-11-04 15:17:12 +08:00
|
|
|
// 获取养护站详情
|
|
|
|
|
const getYHZDetail = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const res = await request({
|
|
|
|
|
url: `/api/yhz/${53}`, // 假设获取的是id为53的养护站的详情
|
|
|
|
|
method: "GET",
|
|
|
|
|
});
|
2025-11-04 17:29:45 +08:00
|
|
|
if (res.code && res.code === "00000") {
|
|
|
|
|
detailData.value = res.data;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(res.message);
|
|
|
|
|
}
|
2025-11-04 15:17:12 +08:00
|
|
|
} catch (error) {
|
2025-11-04 17:29:45 +08:00
|
|
|
showToast({
|
|
|
|
|
message: error.message,
|
|
|
|
|
type: "error",
|
|
|
|
|
});
|
2025-11-04 15:17:12 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-04 17:29:45 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
getYHZDetail();
|
|
|
|
|
});
|
|
|
|
|
|
2025-10-15 14:07:39 +08:00
|
|
|
const goToUser = () => {
|
2025-10-16 15:04:54 +08:00
|
|
|
router.push("/user");
|
|
|
|
|
};
|
2025-10-15 14:07:39 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.home {
|
2025-10-16 15:04:54 +08:00
|
|
|
padding-top: var(--van-nav-bar-height); /* 自动匹配导航栏高度 */
|
2025-10-15 14:07:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.grid {
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|