YNUtdPlatform/pages/workPlan/workbench/components/infrastructure-model.vue

112 lines
2.6 KiB
Vue
Raw Normal View History

2024-10-15 17:01:47 +08:00
<template>
<!-- 现场监护 -->
<view class="infrastructure">
2024-10-27 22:40:40 +08:00
<h4>基建-计划{{ title }}</h4>
2024-10-15 17:01:47 +08:00
<view class="infrastructure-content">
2024-10-25 18:21:10 +08:00
<view
class="icon-box"
v-for="(icon, index) in iconList"
:key="index"
@tap="onOpenPlanPage(icon.url)"
v-show="icon.isShow.includes(roles)"
>
2024-10-15 18:02:51 +08:00
<image :src="icon.img_src" mode="scaleToFill" />
2024-10-15 17:01:47 +08:00
{{ icon.icon_title }}
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
iconList: [
2024-10-15 18:02:51 +08:00
{
icon_title: '日计划',
url: '/pages/workPlan/dayPlan/index',
2024-10-25 18:21:10 +08:00
img_src: require('../../../../static/images/workPlan/day_plan.png'),
isShow: ['22', '23', '24', '25']
2024-10-15 18:02:51 +08:00
},
{
icon_title: '周计划',
url: '/pages/workPlan/weekPlan/index',
2024-10-25 18:21:10 +08:00
img_src: require('../../../../static/images/workPlan/week_plan.png'),
isShow: ['22', '23', '24', '25']
},
{
icon_title: '月计划',
2024-10-27 22:40:40 +08:00
url: '/pages/workPlan/monthPlan/inf-index',
2024-10-25 18:21:10 +08:00
img_src: require('../../../../static/images/workPlan/month_plan.png'),
isShow: ['22', '23', '24', '25']
},
{
icon_title: '涉网计划',
url: '/pages/workPlan/networkPlan/index',
2024-10-25 18:21:10 +08:00
img_src: require('../../../../static/images/workPlan/web_plan.png'),
isShow: ['23', '24', '25']
},
2024-10-15 18:02:51 +08:00
{
icon_title: '临时计划',
url: '/pages/workPlan/tempPlan/index',
2024-10-25 18:21:10 +08:00
img_src: require('../../../../static/images/workPlan/temporary_plan.png'),
isShow: ['23', '24', '25']
2024-10-15 18:02:51 +08:00
}
2024-10-25 18:21:10 +08:00
],
2024-10-27 22:40:40 +08:00
roles: uni.getStorageSync('wkRole'),
title: '填报'
2024-10-15 17:01:47 +08:00
}
},
methods: {
onOpenPlanPage(url) {
2024-10-27 22:40:40 +08:00
uni.navigateTo({ url: `${url}` })
}
},
onLoad() {
if (this.roles === '22') {
this.title = '填报'
}
if (this.roles === '23') {
this.title = '上报'
}
if (this.roles === '24' || this.roles === '25') {
this.title = '审核'
2024-10-15 17:01:47 +08:00
}
}
}
</script>
<style lang="scss" scoped>
.infrastructure-content {
padding: 25rpx 5rpx;
background-color: #fff;
display: flex;
flex-wrap: wrap;
image {
width: 58rpx;
height: 58rpx;
margin-bottom: 30rpx;
}
.icon-box {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
}
}
.infrastructure-content .icon-box:nth-child(4),
.infrastructure-content .icon-box:nth-child(5) {
margin-top: 30rpx;
}
h4 {
margin: 20rpx 0;
padding-left: 15rpx;
font-size: 36rpx;
font-weight: normal;
}
</style>