zhuguifei
2025-06-17 c1cc49dd93d38f51790558541d6835d1598ecccf
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<script setup lang="ts">
import { ref } from "vue";
 
const autoSave = ref(null);
const toggle = () => {
  console.error(1212);
  autoSave.value.toggle();
  console.error(checked.value);
};
const checked = ref(false);
const sampleName = ref("");
 
const activeId = ref(1);
const activeIndex = ref(0);
 
const items = [
  {
    text: "南方",
    children: [
      { text: "大米1", id: 1 },
      { text: "小麦2", id: 2 },
      { text: "玉米3", id: 3 },
      { text: "大米4", id: 4 },
      { text: "小麦5", id: 5 },
      { text: "玉米6", id: 6 },
      { text: "大米7", id: 7 },
      { text: "小麦8", id: 8 },
      { text: "玉米9", id: 9 },
      { text: "大米10", id: 10 },
      { text: "小麦11", id: 11 },
      { text: "玉米12", id: 12 }
    ]
  },
  {
    text: "北方",
    children: [
      { text: "大米", id: 1 },
      { text: "小麦", id: 2 },
      { text: "玉米", id: 3 }
    ]
  },
  { text: "西方" }
];
</script>
 
<template>
  <div class="container">
    <div class="section-one">
      <div class="time-box">
        <div class="w-full h-[60px] flex items-center px-4">
          <div class="w-[6px] h-[20px] bg-[var(--base-green)] rounded-md" />
          <span class="ml-2 text-lg font-bold">检测计时</span>
        </div>
        <div class="flex-1 flex items-center">
          <flop-time ref="floptime" />
        </div>
      </div>
 
      <div class="info-box">
        <div class="w-full h-[60px] flex items-center px-4">
          <div class="w-[6px] h-[20px] bg-[var(--base-green)] rounded-md" />
          <span class="ml-2 text-lg font-bold">设备连接</span>
        </div>
        <van-cell-group>
          <van-cell>
            <template #icon>
              <van-icon name="desktop-o" class="mt-[6px]" size="16" />
            </template>
            <template #title>
              <span class="text-lg ml-1">设备状态</span>
            </template>
            <template #value>
              <span class="text-green text-lg">正常</span>
            </template>
          </van-cell>
          <van-divider />
          <van-cell>
            <template #icon>
              <van-icon name="cluster-o" class="mt-[6px]" size="16" />
            </template>
            <template #title>
              <span class="text-lg ml-1">网络连接</span>
            </template>
            <template #value>
              <span class="text-green text-lg">正常</span>
            </template>
          </van-cell>
          <van-divider />
          <van-cell title="单元格">
            <template #icon>
              <van-icon name="hotel-o" class="mt-[6px]" size="16" />
            </template>
            <template #title>
              <span class="text-lg font-thin ml-1">PLC</span>
              <span class="text-lg">连接</span>
            </template>
            <template #value>
              <span class="text-green text-lg">正常</span>
            </template>
          </van-cell>
        </van-cell-group>
      </div>
    </div>
    <div class="section-two mx-[10px]">
      <div class="w-full h-[60px] flex items-center px-4">
        <div class="w-[6px] h-[20px] bg-[var(--base-green)] rounded-md" />
        <span class="ml-2 text-lg font-bold">检测数据</span>
      </div>
      <van-cell-group>
        <van-cell>
          <template #icon>
            <van-icon name="brush-o" class="mt-[6px]" size="16" />
          </template>
          <template #title>
            <span class="text-lg ml-1">含水率</span>
          </template>
          <template #value>
            <div class="flex justify-end">
              <van-loading size="18" class="text-blue" />
              <span class="text-blue-500 text-lg ml-1">检测中</span>
            </div>
          </template>
        </van-cell>
        <van-divider />
        <van-cell>
          <template #icon>
            <van-icon name="fire-o" class="mt-[6px]" size="16" />
          </template>
          <template #title>
            <span class="text-lg ml-1">温度</span>
          </template>
          <template #value>
            <span class="text-green text-lg">25</span>
            <span class="ml-1 text-black">℃</span>
          </template>
        </van-cell>
        <van-divider />
        <van-cell>
          <template #icon>
            <van-icon name="shop-o" class="mt-[6px]" size="16" />
          </template>
          <template #title>
            <span class="text-lg ml-1">湿度</span>
          </template>
          <template #value>
            <span class="text-green text-lg">45</span>
            <span class="ml-1 text-black">%</span>
          </template>
        </van-cell>
        <van-cell class="mt-5" clickable @click="toggle()">
          <template #icon>
            <van-icon name="setting-o" class="mt-[6px]" size="16" />
          </template>
          <template #title>
            <span class="text-lg ml-1">自动保存样本(s)</span>
          </template>
          <template #right-icon>
            <van-checkbox
              :ref="el => (autoSave = el)"
              v-model="checked"
              shape="square"
            />
          </template>
        </van-cell>
        <van-divider />
        <van-cell>
          <template #icon>
            <van-icon name="edit" class="mt-[6px]" size="17" />
          </template>
          <template #title>
            <span class="text-lg ml-1">样本名称</span>
          </template>
          <template #value>
            <van-field
              v-model="sampleName"
              placeholder="请输入样本名称"
              input-align="right"
            />
          </template>
        </van-cell>
      </van-cell-group>
      <div class="w-full flex justify-center pt-2">
        <van-button icon="plus" type="primary" class="w-[140px]" color="var(--base-green)"
          >检测</van-button
        >
      </div>
    </div>
    <div class="section-three">
      <div class="w-full h-[60px] flex items-center px-4">
        <div class="w-[6px] h-[20px] bg-[var(--base-green)] rounded-md" />
        <span class="ml-2 text-lg font-bold">粮食种类</span>
      </div>
      <van-divider />
      <van-tree-select
        v-model:active-id="activeId"
        v-model:main-active-index="activeIndex"
        :items="items"
      />
    </div>
  </div>
</template>
 
<style scoped lang="less">
.container {
  width: 100vw;
  height: 433px;
  display: flex;
  margin: 0 10px 10px 10px;
  overflow: hidden;
  user-select: none;
 
  .section-one,
  .section-two,
  .section-three {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
  }
  .section-one {
    display: flex;
    flex-direction: column;
 
    .time-box {
      flex: 1;
      background: white;
      border-radius: 10px;
      display: flex;
      flex-direction: column;
    }
 
    .info-box {
      flex: 1;
      background: white;
      margin-top: 10px;
      border-radius: 10px;
      overflow: hidden;
    }
  }
  .section-two {
    border-radius: 10px;
    overflow: hidden;
    background: white;
  }
 
  .section-three{
    background: white;
  }
}
 
.bg-green {
  background: var(--base-green);
}
.text-green {
  color: var(--base-green);
}
.text-blue {
  color: oklch(62.3% 0.214 259.815);
}
 
:deep(.van-sidebar-item--select:before) {
  background: var(--base-green);
}
:deep(.van-tree-select) {
  height: 380px !important;
}
:deep(.van-sidebar-item__text) {
  font-size: 16px;
}
</style>