123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <view class="">
- <view class="cu-list menu-avatar">
- <view class="cu-item deviceTypeItem" v-for="(item,index) in deviceType" :key="index" @tap="goDeviceType(item)">
- <view class="cu-avatar round" :style="`background-image:url(${item.imgUrl})`"></view>
- <view class="content">
- <view class="title">{{item.title}}</view>
- </view>
- <view class="nav-right num">
- <view>
- 共{{item.num}}个设备
- <text class="icon iconfont margin-right-xs margin-left-lg"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import json from '../../data/json.js';
- export default {
- data() {
- return {
- deviceType: json.deviceType,
- getData:{}
- };
- },
- onLoad: function(option) {
- this.getDeviceData({'company_code':uni.getStorageSync('selectedCode')})
- },
- methods: {
- goDeviceType(item) {
- uni.navigateTo({
- url: '/pages/device-Manage/device-Manage?dwtype='+item.dwtype,
- });
- },
-
- // 设备类型数据请求
- async getDeviceData(params = {}) {
- const res = await this.$myRequest({
- url: 'DeviceManagement/getDeviceCount',
- data:params,
- showLoading: true
- })
-
- this.getData=res.data.data[0];
- console.log(this.getData);
- this.deviceType[0].num=this.getData.access_control_device_count;
- this.deviceType[1].num=this.getData.water_meter_device_count
- this.deviceType[2].num=this.getData.electrical_fire_device_count
- this.deviceType[3].num=this.getData.rtu_device_count
-
- this.deviceType[4].num=this.getData.smoke_sensation_device_count
- this.deviceType[5].num=this.getData.video_device_count
- this.deviceType[6].num=this.getData.manhole_cover_device_count
- this.deviceType[6].num=this.getData.fire_hydrant_device_count
-
- },
- }
- }
- </script>
- <style lang="scss">
- </style>
|