policeSecurity/collect_information/src/pages/police/index/index.vue

117 lines
3.4 KiB
Vue
Raw Normal View History

2024-09-25 10:21:43 +08:00
<template>
<view>
<view class="swiperDemo">
<nut-swiper ref="swiperRef" pagination-visible pagination-color="#e53e31" :auto-play="3000" :init-page="0">
2024-11-07 15:02:27 +08:00
<nut-swiper-item v-for="(item, index) in list" :key="index" style="height: 180px">
2024-11-08 16:18:15 +08:00
<image :src="item" alt="" style="height: 100%; width: 100%" draggable="false" />
2024-09-25 10:21:43 +08:00
</nut-swiper-item>
</nut-swiper>
</view>
2024-11-07 15:02:27 +08:00
<view class="nameTitle">
<view class="itemSchool">
2024-11-07 15:02:27 +08:00
<text>单位数量</text>
<text style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 80px; text-align: center">{{ numberStatistics.enterprisesUnitCount }}</text>
2024-11-07 15:02:27 +08:00
</view>
<view class="itemSchool">
<text>服务项目</text>
<text>
{{ numberStatistics.serviceProjectCount }}
2024-11-07 15:02:27 +08:00
</text>
</view>
<view class="itemSchool">
<text>有保安证人员</text>
<text>{{ numberStatistics.securityUserCount }}</text>
2024-11-07 15:02:27 +08:00
</view>
<view class="itemSchool">
<text>无保安证人员</text>
<text>{{ numberStatistics.noCardSecurityUserCount }}</text>
2024-11-07 15:02:27 +08:00
</view>
</view>
2024-09-25 10:21:43 +08:00
<view class="swiperDemoItem">
<view class="swiperDemoIndex"></view>
<view>请选择</view>
</view>
<!--九宫格-->
2024-11-07 15:02:27 +08:00
<view class="Module">
2024-09-25 10:21:43 +08:00
<view class="subModule">
<view class="subModuleItem" v-for="item in subModuleList" :key="item.id" @click="subNavigation(item.url)">
<view class="subModuleIndex">
<image :src="item.icon"></image>
</view>
<view style="font-size: 12px; color: #414141; margin-top: 5px">{{ item.name }}</view>
2024-09-25 10:21:43 +08:00
</view>
</view>
</view>
<view style="background-color: #e9eef4; height: 15rpx"></view>
2024-09-25 10:21:43 +08:00
</view>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
2024-11-08 16:18:15 +08:00
import Taro from '@tarojs/taro'
2024-09-25 10:21:43 +08:00
import icon from '@/assets/images/project.png'
2024-11-07 15:02:27 +08:00
import icon01 from '@/assets/images/回单.jpg'
import icon02 from '@/assets/images/工单.jpg'
import icon03 from '@/assets/images/排名.jpg'
import icon04 from '@/assets/images/法制宣传.jpg'
import icon06 from '@/assets/images/警保风采.jpg'
2024-09-25 10:21:43 +08:00
import './index.scss'
import api from '@/request'
import { DataStatisticsRes } from '@/types/pages/police'
2024-11-07 15:02:27 +08:00
const list = ref([process.env.TARO_APP_MINIO_URL + '/police-security/2024/11/5/dunpai.jpg'])
2024-09-25 10:21:43 +08:00
const swiperRef = ref() //轮播图
const subModuleList = ref([
{
id: 0,
icon: icon,
2024-11-07 15:02:27 +08:00
name: '项目管理',
2024-11-08 16:18:15 +08:00
url: '/subPages/police/myEnterprisesUnit/myEnterprisesUnit',
2024-09-25 10:21:43 +08:00
},
{
id: 1,
2024-11-07 15:02:27 +08:00
icon: icon02,
name: '整改工单',
url: '',
2024-09-25 10:21:43 +08:00
},
{
id: 2,
2024-11-07 15:02:27 +08:00
icon: icon03,
name: '考核排名',
url: '',
2024-11-07 15:02:27 +08:00
},
{
id: 3,
icon: icon06,
name: '警保风采',
url: '',
2024-11-07 15:02:27 +08:00
},
{
id: 4,
icon: icon04,
name: '法制宣传',
url: '',
2024-11-07 15:02:27 +08:00
},
{
id: 5,
icon: icon01,
name: '整改回单',
2024-11-08 16:18:15 +08:00
url: '',
},
2024-09-25 10:21:43 +08:00
])
const numberStatistics = ref<DataStatisticsRes>({
enterprisesUnitCount: 0,
serviceProjectCount: 0,
securityUserCount: 0,
noCardSecurityUserCount: 0,
2024-11-07 15:02:27 +08:00
})
const dataStatistics = async () => {
const resp = await api.get<DataStatisticsRes>('/policeIndex/dataStatistics')
numberStatistics.value = resp.data as DataStatisticsRes
2024-11-07 15:02:27 +08:00
}
onMounted(async () => {
2024-11-07 15:02:27 +08:00
await dataStatistics()
})
2024-11-08 16:18:15 +08:00
const subNavigation = async (url: string) => Taro.navigateTo({ url })
2024-09-25 10:21:43 +08:00
</script>