feat: 调整首页
This commit is contained in:
parent
f24ce93621
commit
b7c1a2e231
BIN
packages/mobile/src/assets/images/组 104.png
Normal file
BIN
packages/mobile/src/assets/images/组 104.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
packages/mobile/src/assets/images/组 105(1).png
Normal file
BIN
packages/mobile/src/assets/images/组 105(1).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
packages/mobile/src/assets/images/组 105.png
Normal file
BIN
packages/mobile/src/assets/images/组 105.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
packages/mobile/src/assets/images/组 106.png
Normal file
BIN
packages/mobile/src/assets/images/组 106.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
packages/mobile/src/assets/images/组 63.png
Normal file
BIN
packages/mobile/src/assets/images/组 63.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@ -67,7 +67,7 @@ const routes = [
|
|||||||
component: () => import('../views/IceEvent/IceEventDetails.vue')
|
component: () => import('../views/IceEvent/IceEventDetails.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/warningMessage/:data',
|
path: '/warningMessage',
|
||||||
name: 'WarningMessage',
|
name: 'WarningMessage',
|
||||||
component: () => import('../views/WarningMessage/WarningMessage.vue')
|
component: () => import('../views/WarningMessage/WarningMessage.vue')
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,53 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="home">
|
<PageContainer title="愉快政">
|
||||||
<van-nav-bar title="愉快政" fixed left-arrow />
|
<CurrentSite />
|
||||||
|
|
||||||
<van-cell-group>
|
|
||||||
<van-cell title="当前站点" :value="yhzinfo.mc" />
|
|
||||||
</van-cell-group>
|
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<van-grid :gutter="10" :column-num="3" class="grid">
|
<van-grid :gutter="10" :column-num="3" class="grid">
|
||||||
<van-grid-item
|
<van-grid-item
|
||||||
icon="setting-o"
|
class="grid-item"
|
||||||
text="设备管理"
|
v-for="item in gridItems"
|
||||||
:to="{
|
:key="item.text"
|
||||||
name: 'EquipManage',
|
:to="item.to"
|
||||||
params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
|
>
|
||||||
}"
|
<template #icon>
|
||||||
/>
|
<img :src="item.icon" class="grid-icon" />
|
||||||
<van-grid-item
|
</template>
|
||||||
icon="setting-o"
|
<template #text>
|
||||||
text="物资管理"
|
<span class="grid-text">{{ item.text }}</span>
|
||||||
:to="{
|
</template>
|
||||||
name: 'MaterialManage',
|
</van-grid-item>
|
||||||
params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
<van-grid-item
|
|
||||||
icon="setting-o"
|
|
||||||
text="人员管理"
|
|
||||||
:to="{
|
|
||||||
name: 'StaffManage',
|
|
||||||
params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
<van-grid-item
|
|
||||||
icon="setting-o"
|
|
||||||
text="冰雪灾害"
|
|
||||||
:to="{
|
|
||||||
name: 'IceEventManage',
|
|
||||||
params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
<van-grid-item
|
|
||||||
icon="setting-o"
|
|
||||||
text="气象预警"
|
|
||||||
:to="{
|
|
||||||
name: 'WarningMessage',
|
|
||||||
params: { data: encodeURIComponent(JSON.stringify(yhzinfo)) },
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</van-grid>
|
</van-grid>
|
||||||
</div>
|
</div>
|
||||||
<van-popup
|
<van-popup
|
||||||
@ -69,7 +38,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
</div>
|
</PageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -80,6 +49,14 @@ import { useRouter, useRoute } from "vue-router";
|
|||||||
import { useYHZStore } from "../stores/yhzStore";
|
import { useYHZStore } from "../stores/yhzStore";
|
||||||
import { showToast } from "vant";
|
import { showToast } from "vant";
|
||||||
import { request } from "../../../shared/utils/request";
|
import { request } from "../../../shared/utils/request";
|
||||||
|
import PageContainer from "@/components/PageContainer.vue";
|
||||||
|
import CurrentSite from "@/components/CurrentSite.vue";
|
||||||
|
|
||||||
|
import group63Icon from "@/assets/images/组 63.png";
|
||||||
|
import group105Icon from "@/assets/images/组 105.png";
|
||||||
|
import group10501Icon from "@/assets/images/组 105(1).png";
|
||||||
|
import group104Icon from "@/assets/images/组 104.png";
|
||||||
|
import group106Icon from "@/assets/images/组 106.png";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const yhzinfo = ref({});
|
const yhzinfo = ref({});
|
||||||
@ -89,6 +66,49 @@ const route = useRoute();
|
|||||||
const token = route.query.token;
|
const token = route.query.token;
|
||||||
const YHZConfirmpopup = ref(false);
|
const YHZConfirmpopup = ref(false);
|
||||||
|
|
||||||
|
// 配置项
|
||||||
|
const gridItems = [
|
||||||
|
{
|
||||||
|
icon: group63Icon,
|
||||||
|
text: "设备管理",
|
||||||
|
to: {
|
||||||
|
name: "EquipManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzinfo.value)) },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: group10501Icon,
|
||||||
|
text: "物资管理",
|
||||||
|
to: {
|
||||||
|
name: "MaterialManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzinfo.value)) },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: group104Icon,
|
||||||
|
text: "人员管理",
|
||||||
|
to: {
|
||||||
|
name: "StaffManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzinfo.value)) },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: group106Icon,
|
||||||
|
text: "冰雪灾害",
|
||||||
|
to: {
|
||||||
|
name: "IceEventManage",
|
||||||
|
params: { data: encodeURIComponent(JSON.stringify(yhzinfo.value)) },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: group105Icon,
|
||||||
|
text: "预警信息",
|
||||||
|
to: {
|
||||||
|
name: "WarningMessage",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// 获取当前登录用于就职的养护站信息
|
// 获取当前登录用于就职的养护站信息
|
||||||
const getYHZinfo = async () => {
|
const getYHZinfo = async () => {
|
||||||
try {
|
try {
|
||||||
@ -99,6 +119,13 @@ const getYHZinfo = async () => {
|
|||||||
if (res.code === "00000") {
|
if (res.code === "00000") {
|
||||||
yhzinfo.value = res.data[0];
|
yhzinfo.value = res.data[0];
|
||||||
yhzStore.setYHZInfo(res.data[0]);
|
yhzStore.setYHZInfo(res.data[0]);
|
||||||
|
|
||||||
|
// 更新配置项中的params,确保使用最新的yhzinfo
|
||||||
|
gridItems.forEach(item => {
|
||||||
|
if (item.to.params && item.to.params.data) {
|
||||||
|
item.to.params.data = encodeURIComponent(JSON.stringify(yhzinfo.value));
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message);
|
throw new Error(res.message);
|
||||||
}
|
}
|
||||||
@ -114,6 +141,11 @@ const onYHZConfirmClose = () => {
|
|||||||
YHZConfirmpopup.value = false;
|
YHZConfirmpopup.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getLocation = () => {
|
||||||
|
// 定位逻辑
|
||||||
|
YHZConfirmpopup.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (token) {
|
if (token) {
|
||||||
localStorage.setItem("token", token);
|
localStorage.setItem("token", token);
|
||||||
@ -135,19 +167,7 @@ const goToUser = () => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
.home {
|
|
||||||
padding-top: var(--van-nav-bar-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid {
|
|
||||||
margin-top: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-box {
|
.btn-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -161,4 +181,24 @@ const goToUser = () => {
|
|||||||
.confirmpopup__content {
|
.confirmpopup__content {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.grid-icon {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-text {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #323233;
|
||||||
|
}
|
||||||
|
:deep(.grid-item) {
|
||||||
|
.grid-text {
|
||||||
|
margin-top: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -3,9 +3,9 @@
|
|||||||
<CurrentSite />
|
<CurrentSite />
|
||||||
|
|
||||||
<div class="form-panel">
|
<div class="form-panel">
|
||||||
<van-field v-model="value" label="现场情况描述" placeholder="请输入备注" label-align="top" rows="3" type="textarea" />
|
<van-field v-model="form.a" label="现场情况描述" placeholder="请输入备注" label-align="top" rows="3" type="textarea" />
|
||||||
|
|
||||||
<van-field class="mt-8" v-model="value" label="备注(非必填)" placeholder="请填写" input-align="right" />
|
<van-field class="mt-8" v-model="form.b" label="备注(非必填)" placeholder="请填写" input-align="right" />
|
||||||
|
|
||||||
<div class="image-upload-block">
|
<div class="image-upload-block">
|
||||||
<div class="label-box">
|
<div class="label-box">
|
||||||
@ -45,39 +45,22 @@ const router = useRouter()
|
|||||||
// 上传附件相关
|
// 上传附件相关
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
a: '',
|
||||||
|
b: '',
|
||||||
|
photos: []
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData()
|
getData()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 列表数据
|
|
||||||
const list = ref([
|
|
||||||
{
|
|
||||||
area: '合川区',
|
|
||||||
level: '红色气象预警',
|
|
||||||
content: '今天,北京将进入大雪,请做好',
|
|
||||||
publishTime: '2026/01/10 20:29',
|
|
||||||
method: '立即启动防汛Ⅰ级应急响应,立即转移危险区'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
area: '万州区',
|
|
||||||
level: '红色气象预警',
|
|
||||||
publishTime: '2025/10/10 20:29',
|
|
||||||
method: '立即启动防汛Ⅰ级应急响应,立即转移危险区'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
area: '涪陵区',
|
|
||||||
level: '红色气象预警',
|
|
||||||
publishTime: '2025/10/10 20:29',
|
|
||||||
method: '立即启动防汛Ⅰ级应急响应,立即转移危险区'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
// 文件删除
|
// 文件删除
|
||||||
const handleDelete = (file) => {
|
const handleDelete = (file) => {
|
||||||
if (file.serverUrl) {
|
if (file.serverUrl) {
|
||||||
const index = editForm.photos.findIndex((p) => p.photoUrl === file.serverUrl)
|
const index = form.value.photos.findIndex((p) => p.photoUrl === file.serverUrl)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
editForm.photos.splice(index, 1)
|
form.value.photos.splice(index, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,13 +82,13 @@ const afterRead = async (file) => {
|
|||||||
})
|
})
|
||||||
toast.close()
|
toast.close()
|
||||||
if (res.code === '00000') {
|
if (res.code === '00000') {
|
||||||
editForm.photos.push({ photoUrl: res.data })
|
form.value.photos.push({ photoUrl: res.data })
|
||||||
const index = fileList.value.findIndex((f) => f.file === file.file)
|
const index = fileList.value.findIndex((f) => f.file === file.file)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
fileList.value[index].serverUrl = res.data
|
fileList.value[index].serverUrl = res.data
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('editForm.photos', toRaw(editForm.photos))
|
console.log('form.value.photos', toRaw(form.value.photos))
|
||||||
console.log('fileList.value', fileList.value)
|
console.log('fileList.value', fileList.value)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message)
|
throw new Error(res.message)
|
||||||
@ -124,8 +107,10 @@ const getData = async () => {}
|
|||||||
const handleClickBack = () => {
|
const handleClickBack = () => {
|
||||||
router.go(-1)
|
router.go(-1)
|
||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = async () => {
|
||||||
router.push({ path: '/warningMessageHandle' })
|
console.log(form.value)
|
||||||
|
|
||||||
|
router.go(-1)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user