车间能级提升-智能设备管理系统
zhuguifei
2025-04-18 7db4e38c6d967d511f0c1248bf22ceaf6a6f55d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
<route lang="json5" type="home">
{
  layout: 'tabbar',
  style: {
    navigationBarTitleText: '首页',
  },
}
</route>
<template>
  <view
    class="bg-base overflow-hidden"
    :style="{
      marginTop: safeAreaInsets?.top + 'px',
    }"
  >
    <view class="bg-white h-[80rpx] px-2 flex items-center justify-between">
      <view class="flex items-center" @click="handleUserInfo">
        <wd-icon name="user" size="40rpx" class="icon-color-base"></wd-icon>
        <text class="ml-1 text-color-base">张三</text>
      </view>
 
      <view class="flex items-center">
        <wd-icon name="notification" size="40rpx" class="icon-color-base mr-3"></wd-icon>
        <wd-icon name="tips" size="40rpx" class="icon-color-base mr-3"></wd-icon>
        <wd-icon name="app" size="40rpx" class="icon-color-base"></wd-icon>
      </view>
    </view>
 
    <view class="bg-white py-2 px-2">
      <wd-img class="w-full h-[260rpx]" src="/static/images/pic4.jpeg" />
    </view>
    <view class="bg-noti flex flex-row">
      <wd-notice-bar
        text="这是一条消息提示信息,这是一条消息提示信息,这是一条消息提示信息"
        prefix="clock"
        type="info"
        :scrollable="false"
        custom-class="flex-1  overflow-hidden"
      />
      <wd-button type="text" class="w-[120rpx]">查看</wd-button>
    </view>
 
    <view class="bg-white">
      <wd-card type="rectangle">
        <template #title>
          <view class="flex items-center menu-title-box">
            <view class="menu-indicator"></view>
            <view class="ml-1 text-xs">数据总览</view>
          </view>
        </template>
        <view class="flex flex-row justify-around">
          <view class="flex flex-col justify-center">
            <text class="text-lg text-center">0</text>
            <text class="text-color-gray">设备总数</text>
          </view>
          <view class="flex flex-col justify-center">
            <text class="text-lg text-center">0</text>
            <text class="text-color-gray">故障设备数</text>
          </view>
          <view class="flex flex-col justify-center">
            <text class="text-lg text-center">0</text>
            <text class="text-color-gray">未修复故障</text>
          </view>
        </view>
      </wd-card>
    </view>
 
    <view class="bg-white mt-2">
      <wd-card type="rectangle">
        <template #title>
          <view class="flex items-center menu-title-box">
            <view class="menu-indicator"></view>
            <view class="ml-1 text-xs">数据总览</view>
          </view>
        </template>
        <wd-grid :column="4">
          <wd-grid-item use-slot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
          <wd-grid-item use-slot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
          <wd-grid-item use-slot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
          <wd-grid-item use-slot is-dot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
          <wd-grid-item use-slot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
          <wd-grid-item use-slot class="flex justify-center items-center">
            <image class="slot-img text-center" src="/static/menu/menu2.png" />
            <text>12</text>
          </wd-grid-item>
        </wd-grid>
      </wd-card>
    </view>
 
    <view class="bg-white mt-2">
      <wd-card type="rectangle">
        <template #title>
          <view class="flex items-center menu-title-box">
            <view class="menu-indicator"></view>
            <view class="ml-1 text-xs">数据总览</view>
          </view>
        </template>
        <wd-grid :column="4">
          <wd-grid-item
            use-slot
            class="flex justify-center items-center"
            v-for="(item, index) in menuList"
            :key="item.id"
          >
            <image class="slot-img text-center" :src="item.url" />
            <text>{{ item.name }}</text>
          </wd-grid-item>
        </wd-grid>
      </wd-card>
    </view>
  </view>
</template>
 
<script lang="ts" setup>
import { getAllMenusApi } from '@/service/menu'
 
defineOptions({
  name: 'Home',
})
 
// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()
 
const getAllMenus = async () => {
  const menuList = await getAllMenusApi()
  console.error(menuList)
}
 
onLoad(() => {
  // getAllMenus()
})
 
const menuList = reactive([
  {
    id: 1,
    name: '测试',
    url: '/static/menu/menu1.png',
  },
  {
    id: 2,
    name: '测试',
    url: '/static/menu/menu1.png',
  },
])
 
function handleUserInfo() {
  getAllMenus()
}
 
 
</script>
 
<style lang="scss" scoped>
.main-title-color {
  color: $uni-color-primary;
}
 
.bg-noti {
  background: #f4f9ff;
}
 
:deep(.wd-card) {
  margin-bottom: 0;
}
 
:deep(.wd-card__footer) {
  padding: 0 !important;
}
 
:deep(.wd-card__footer)::after {
  height: 0 !important;
}
 
.menu-title-box {
  height: 30rpx;
}
 
.menu-indicator {
  width: 6rpx;
  height: 24rpx;
  border-radius: 10rpx;
  background-color: $uni-color-primary;
}
 
.slot-img {
  width: 72rpx;
  height: 72rpx;
  border-radius: 8rpx;
}
</style>