|
@@ -0,0 +1,926 @@
|
|
1
|
+<!--
|
|
2
|
+ * @Author: ysh
|
|
3
|
+ * @Date: 2025-06-10 09:34:55
|
|
4
|
+ * @LastEditors: Please set LastEditors
|
|
5
|
+ * @LastEditTime: 2025-06-11 16:29:46
|
|
6
|
+-->
|
|
7
|
+<template>
|
|
8
|
+ <view>
|
|
9
|
+ <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" @scrolltolower="lower"
|
|
10
|
+ @scroll="scroll" :refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh"
|
|
11
|
+ :lower-threshold="50" :upper-threshold="50">
|
|
12
|
+ <view class="content-wrapper">
|
|
13
|
+ <!-- 搜索栏 -->
|
|
14
|
+ <view class="search-bar">
|
|
15
|
+ <view class="search-input-wrapper">
|
|
16
|
+ <uni-icons type="search" size="16" color="#999"></uni-icons>
|
|
17
|
+ <input class="search-input" v-model="queryParams.projectNumber" placeholder="请输入项目编号搜索"
|
|
18
|
+ @confirm="handleSearch" />
|
|
19
|
+ <uni-icons v-if="queryParams.projectNumber" type="clear" size="16" color="#999"
|
|
20
|
+ @click="clearSearch"></uni-icons>
|
|
21
|
+ </view>
|
|
22
|
+ </view>
|
|
23
|
+ <template v-if="logList.length > 0">
|
|
24
|
+ <view class="project-card" v-for="(item, index) in logList" :key="index">
|
|
25
|
+ <view class="project-card-item">
|
|
26
|
+ <view class="project-card-item-header">
|
|
27
|
+ <view class="project-info">
|
|
28
|
+ <text class="project-number">{{ item.project ? item.project.projectNumber : '无项目' }}</text>
|
|
29
|
+ <text class="project-name">{{ item.project ? item.project.projectName : '无项目' }}</text>
|
|
30
|
+ </view>
|
|
31
|
+ <view class="action-buttons">
|
|
32
|
+ <button class="action-btn edit" v-if="isOwnRecord(item)" @click="handleEdit(item)">
|
|
33
|
+ <uni-icons type="compose" size="16" color="#007AFF"></uni-icons>
|
|
34
|
+ </button>
|
|
35
|
+ <button class="action-btn delete" v-if="isOwnRecord(item)" @click="handleDelete(item)">
|
|
36
|
+ <uni-icons type="trash" size="16" color="#FF3B30"></uni-icons>
|
|
37
|
+ </button>
|
|
38
|
+ </view>
|
|
39
|
+ </view>
|
|
40
|
+ <view class="project-card-item-content">
|
|
41
|
+ <view class="info-row">
|
|
42
|
+ <text class="info-label">设备名称:</text>
|
|
43
|
+ <text class="info-value" v-if="item.deviceId">{{ item.device ? item.device.name : '' }}-{{ item.device
|
|
44
|
+ ? item.device.brand : '' }}({{
|
|
45
|
+ item.device ? item.device.code : '' }})</text>
|
|
46
|
+ <text class="info-value" v-else>暂无设备</text>
|
|
47
|
+ </view>
|
|
48
|
+ <view class="info-row">
|
|
49
|
+ <text class="info-label">设备类型:</text>
|
|
50
|
+ <text class="info-value">{{ item.usageType }}</text>
|
|
51
|
+ </view>
|
|
52
|
+ <view class="info-row">
|
|
53
|
+ <text class="info-label">使用日期:</text>
|
|
54
|
+ <text class="info-value">{{ item.useDate }}</text>
|
|
55
|
+ </view>
|
|
56
|
+ <view class="info-row">
|
|
57
|
+ <text class="info-label">记录员:</text>
|
|
58
|
+ <text class="info-value">{{ item.user.nickName }}</text>
|
|
59
|
+ </view>
|
|
60
|
+ <view class="info-row">
|
|
61
|
+ <text class="info-label">点号:</text>
|
|
62
|
+ <text class="info-value">{{ item.position }}</text>
|
|
63
|
+ </view>
|
|
64
|
+ <view class="info-row">
|
|
65
|
+ <text class="info-label">高值类型:</text>
|
|
66
|
+ <text class="info-value">{{ item.heightType }}</text>
|
|
67
|
+ </view>
|
|
68
|
+ <view class="info-row">
|
|
69
|
+ <text class="info-label">高值:</text>
|
|
70
|
+ <text class="info-value">{{ item.height }}m</text>
|
|
71
|
+ </view>
|
|
72
|
+ <view class="info-row">
|
|
73
|
+ <text class="info-label">天气:</text>
|
|
74
|
+ <text class="info-value">{{ item.weather }}</text>
|
|
75
|
+ </view>
|
|
76
|
+ <view class="info-row">
|
|
77
|
+ <text class="info-label">干温:</text>
|
|
78
|
+ <text class="info-value">{{ item.dryTemperature }}°C</text>
|
|
79
|
+ </view>
|
|
80
|
+ <view class="info-row">
|
|
81
|
+ <text class="info-label">湿温:</text>
|
|
82
|
+ <text class="info-value">{{ item.wetTemperature }}°C</text>
|
|
83
|
+ </view>
|
|
84
|
+ <view class="info-row">
|
|
85
|
+ <text class="info-label">气压:</text>
|
|
86
|
+ <text class="info-value">{{ item.airPressure }}hPa</text>
|
|
87
|
+ </view>
|
|
88
|
+ <view class="info-row">
|
|
89
|
+ <text class="info-label">开机时间:</text>
|
|
90
|
+ <text class="info-value">{{ formatDateTime(item.powerOn) }}</text>
|
|
91
|
+ </view>
|
|
92
|
+ <view class="info-row">
|
|
93
|
+ <text class="info-label">关机时间:</text>
|
|
94
|
+ <text class="info-value">{{ formatDateTime(item.powerOff) }}</text>
|
|
95
|
+ </view>
|
|
96
|
+ </view>
|
|
97
|
+ </view>
|
|
98
|
+ </view>
|
|
99
|
+ <view class="loading-more" v-if="hasMore">
|
|
100
|
+ <text class="loading-text">加载中...</text>
|
|
101
|
+ </view>
|
|
102
|
+ <view class="no-more" v-else>
|
|
103
|
+ <text class="no-more-text">没有更多数据了</text>
|
|
104
|
+ </view>
|
|
105
|
+ </template>
|
|
106
|
+ <view v-else class="empty-state">
|
|
107
|
+ <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image>
|
|
108
|
+ <text class="empty-text">暂无数据</text>
|
|
109
|
+ </view>
|
|
110
|
+ </view>
|
|
111
|
+ </scroll-view>
|
|
112
|
+
|
|
113
|
+ <!-- 悬浮按钮 -->
|
|
114
|
+ <view class="fab-button" @click="handleAdd">
|
|
115
|
+ <uni-icons type="plusempty" size="24" color="#fff"></uni-icons>
|
|
116
|
+ </view>
|
|
117
|
+
|
|
118
|
+ <!-- 新增记录弹窗 -->
|
|
119
|
+ <uni-popup ref="addPopup" type="center">
|
|
120
|
+ <view class="popup-content">
|
|
121
|
+ <view class="popup-header">
|
|
122
|
+ <text class="title">{{ isEdit ? '修改记录' : '新增记录' }}</text>
|
|
123
|
+ <uni-icons type="close" size="20" @click="closePopup"></uni-icons>
|
|
124
|
+ </view>
|
|
125
|
+ <view class="popup-body">
|
|
126
|
+ <view class="form-item">
|
|
127
|
+ <text class="label">项目选择</text>
|
|
128
|
+ <view class="project-picker" @click="showProjectPicker">
|
|
129
|
+ <text v-if="selectedProject">{{ selectedProject.projectName }}</text>
|
|
130
|
+ <text v-else class="placeholder">请选择项目</text>
|
|
131
|
+ </view>
|
|
132
|
+ </view>
|
|
133
|
+ <view class="form-item">
|
|
134
|
+ <text class="label">设备选择</text>
|
|
135
|
+ <view class="project-picker" @click="showDevicePicker">
|
|
136
|
+ <text v-if="selectDevice && selectDevice.code">{{ selectDevice.name }}-{{ selectDevice.brand }}({{
|
|
137
|
+ selectDevice.code
|
|
138
|
+ }})</text>
|
|
139
|
+ <text v-else class="placeholder">请选择设备</text>
|
|
140
|
+ </view>
|
|
141
|
+ </view>
|
|
142
|
+ <view class="form-item">
|
|
143
|
+ <text class="label">设备类型</text>
|
|
144
|
+ <uni-data-select v-model="formData.usageType" :localdata="useTypeOptions" placeholder="请选择设备类型"
|
|
145
|
+ class="weather-select" @change="handleUseTypeChange" />
|
|
146
|
+ </view>
|
|
147
|
+ <view class="form-item">
|
|
148
|
+ <text class="label">使用日期</text>
|
|
149
|
+ <!-- <uni-datetime-picker v-model="formData.useDate" type="date" /> -->
|
|
150
|
+ <uv-calendar ref="calendar" mode="single" @confirm="confirmUseDate"></uv-calendar>
|
|
151
|
+ <view class="project-picker" @click="$refs.calendar.open()">
|
|
152
|
+ <text v-if="formData.useDate">{{ formData.useDate }}</text>
|
|
153
|
+ <text v-else class="placeholder">请选择日期</text>
|
|
154
|
+ </view>
|
|
155
|
+ </view>
|
|
156
|
+ <view class="form-item">
|
|
157
|
+ <text class="label">点号</text>
|
|
158
|
+ <input v-model="formData.position" placeholder="请输入点号" />
|
|
159
|
+ </view>
|
|
160
|
+ <view class="form-item">
|
|
161
|
+ <text class="label">高值类型</text>
|
|
162
|
+ <uni-data-select v-model="formData.heightType" :localdata="highTypeOptions" placeholder="请选择高值类型"
|
|
163
|
+ class="weather-select" @change="handleHighTypeChange" />
|
|
164
|
+ </view>
|
|
165
|
+ <view class="form-item">
|
|
166
|
+ <text class="label">高值(m)</text>
|
|
167
|
+ <input v-model="formData.height" type="number" placeholder="请输入高值" />
|
|
168
|
+ </view>
|
|
169
|
+ <view class="form-item">
|
|
170
|
+ <text class="label">天气</text>
|
|
171
|
+ <uni-data-select v-model="formData.weather" :localdata="weatherOptions" placeholder="请选择天气"
|
|
172
|
+ class="weather-select" />
|
|
173
|
+ </view>
|
|
174
|
+ <view class="form-item">
|
|
175
|
+ <text class="label">干温 (°C)</text>
|
|
176
|
+ <input v-model="formData.dryTemperature" type="number" placeholder="请输入干温" />
|
|
177
|
+ </view>
|
|
178
|
+ <view class="form-item">
|
|
179
|
+ <text class="label">湿温 (°C)</text>
|
|
180
|
+ <input v-model="formData.wetTemperature" type="number" placeholder="请输入湿温" />
|
|
181
|
+ </view>
|
|
182
|
+ <view class="form-item">
|
|
183
|
+ <text class="label">气压 (hPa)</text>
|
|
184
|
+ <input v-model="formData.airPressure" type="number" placeholder="请输入气压" />
|
|
185
|
+ </view>
|
|
186
|
+ <view class="form-item" v-if="formData.usageType !== '全站仪'">
|
|
187
|
+ <text class="label">开机时间</text>
|
|
188
|
+ <view class="datetime-picker" @click="openPowerOnPicker">
|
|
189
|
+ <text v-if="formData.powerOn">{{ formatDateTime(formData.powerOn) }}</text>
|
|
190
|
+ <text v-else class="placeholder">请选择开机时间</text>
|
|
191
|
+ </view>
|
|
192
|
+ </view>
|
|
193
|
+ <view class="form-item" v-if="formData.usageType !== '全站仪'">
|
|
194
|
+ <text class="label">关机时间</text>
|
|
195
|
+ <view class="datetime-picker" @click="openPowerOffPicker">
|
|
196
|
+ <text v-if="formData.powerOff">{{ formatDateTime(formData.powerOff) }}</text>
|
|
197
|
+ <text v-else class="placeholder">请选择关机时间</text>
|
|
198
|
+ </view>
|
|
199
|
+ </view>
|
|
200
|
+ </view>
|
|
201
|
+ <view class="popup-footer">
|
|
202
|
+ <button class="btn cancel" @click="closePopup">取消</button>
|
|
203
|
+ <button class="btn confirm" @click="submitForm">确定</button>
|
|
204
|
+ </view>
|
|
205
|
+ </view>
|
|
206
|
+ </uni-popup>
|
|
207
|
+
|
|
208
|
+ <!-- 项目选择器 -->
|
|
209
|
+ <project-picker :visible.sync="showPicker" :selected.sync="selectedProject" @confirm="handleProjectSelect" />
|
|
210
|
+ <!-- 设备选择器 -->
|
|
211
|
+ <device-picker :visible.sync="openDevice" :selected.sync="selectDevice" :multiple="false"
|
|
212
|
+ @confirm="handleDeviceSelect"></device-picker>
|
|
213
|
+ <!-- 时间选择器 -->
|
|
214
|
+ <uv-datetime-picker ref="powerOnPicker" v-model="formData.powerOn" mode="datetime"
|
|
215
|
+ @confirm="handlePowerOnConfirm"></uv-datetime-picker>
|
|
216
|
+ <uv-datetime-picker ref="powerOffPicker" v-model="formData.powerOff" mode="datetime"
|
|
217
|
+ @confirm="handlePowerOffConfirm"></uv-datetime-picker>
|
|
218
|
+ </view>
|
|
219
|
+</template>
|
|
220
|
+
|
|
221
|
+<script>
|
|
222
|
+import { listDeviceLog, getDeviceLog, addDeviceLog, updateDeviceLog, delDeviceLog } from '@/api/oa/device/deviceLog';
|
|
223
|
+import { listProject } from '@/api/oa/project/project';
|
|
224
|
+import ProjectPicker from '@/pages/components/ProjectPicker.vue';
|
|
225
|
+import DevicePicker from '@/pages/components/DevicePicker.vue';
|
|
226
|
+import { parseTime } from '@/utils/common';
|
|
227
|
+
|
|
228
|
+export default {
|
|
229
|
+ components: {
|
|
230
|
+ ProjectPicker,
|
|
231
|
+ DevicePicker
|
|
232
|
+ },
|
|
233
|
+ data() {
|
|
234
|
+ return {
|
|
235
|
+ logList: [],
|
|
236
|
+ scrollTop: 0,
|
|
237
|
+ queryParams: {
|
|
238
|
+ pageNum: 1,
|
|
239
|
+ pageSize: 10,
|
|
240
|
+ userId: null,
|
|
241
|
+ projectNumber: ''
|
|
242
|
+ },
|
|
243
|
+ showPicker: false,
|
|
244
|
+ selectedProject: null,
|
|
245
|
+ openDevice: false,
|
|
246
|
+ selectDevice: {},
|
|
247
|
+ weatherOptions: [
|
|
248
|
+ { text: '晴', value: '晴' },
|
|
249
|
+ { text: '阴', value: '阴' },
|
|
250
|
+ { text: '多云', value: '多云' },
|
|
251
|
+ { text: '雨', value: '雨' },
|
|
252
|
+ { text: '雪', value: '雪' }
|
|
253
|
+ ],
|
|
254
|
+ highTypeOptions: [],
|
|
255
|
+ useTypeOptions: [
|
|
256
|
+ { text: '全站仪', value: '全站仪' },
|
|
257
|
+ { text: 'GNSS基站', value: 'GNSS基站' },
|
|
258
|
+ { text: 'GNSS静态', value: 'GNSS静态' }
|
|
259
|
+ ],
|
|
260
|
+ formData: {
|
|
261
|
+ useDate: '',
|
|
262
|
+ weather: '',
|
|
263
|
+ position: '',
|
|
264
|
+ dryTemperature: '',
|
|
265
|
+ wetTemperature: '',
|
|
266
|
+ airPressure: '',
|
|
267
|
+ heightType: '',
|
|
268
|
+ height: '',
|
|
269
|
+ powerOn: '',
|
|
270
|
+ powerOff: '',
|
|
271
|
+ usageType: ''
|
|
272
|
+ },
|
|
273
|
+ isEdit: false,
|
|
274
|
+ currentLogId: null,
|
|
275
|
+ hasMore: true,
|
|
276
|
+ loading: false,
|
|
277
|
+ isRefreshing: false
|
|
278
|
+ }
|
|
279
|
+ },
|
|
280
|
+ created() {
|
|
281
|
+ this.getList()
|
|
282
|
+ },
|
|
283
|
+ methods: {
|
|
284
|
+ async getList() {
|
|
285
|
+ if (this.loading) return
|
|
286
|
+ this.loading = true
|
|
287
|
+
|
|
288
|
+ try {
|
|
289
|
+ if (this.$store.getters.roles.includes('leader') || this.$store.getters.roles.includes('dept')) {
|
|
290
|
+ this.queryParams.userId = null
|
|
291
|
+ } else {
|
|
292
|
+ this.queryParams.userId = this.$store.getters.userId
|
|
293
|
+ }
|
|
294
|
+
|
|
295
|
+ const res = await listDeviceLog(this.queryParams)
|
|
296
|
+ if (this.queryParams.pageNum === 1) {
|
|
297
|
+ this.logList = res.rows
|
|
298
|
+ } else {
|
|
299
|
+ this.logList = [...this.logList, ...res.rows]
|
|
300
|
+ }
|
|
301
|
+
|
|
302
|
+ this.hasMore = res.rows.length === this.queryParams.pageSize
|
|
303
|
+ } catch (error) {
|
|
304
|
+ uni.showToast({
|
|
305
|
+ title: '加载失败',
|
|
306
|
+ icon: 'error'
|
|
307
|
+ })
|
|
308
|
+ } finally {
|
|
309
|
+ this.loading = false
|
|
310
|
+ }
|
|
311
|
+ },
|
|
312
|
+ async onRefresh() {
|
|
313
|
+ this.isRefreshing = true
|
|
314
|
+ this.queryParams.pageNum = 1
|
|
315
|
+ this.hasMore = true
|
|
316
|
+ await this.getList()
|
|
317
|
+ this.isRefreshing = false
|
|
318
|
+ },
|
|
319
|
+ upper() {
|
|
320
|
+ // 下拉刷新
|
|
321
|
+ this.onRefresh()
|
|
322
|
+ },
|
|
323
|
+ lower() {
|
|
324
|
+ // 上拉加载更多
|
|
325
|
+ if (this.hasMore && !this.loading) {
|
|
326
|
+ this.queryParams.pageNum++
|
|
327
|
+ this.getList()
|
|
328
|
+ }
|
|
329
|
+ },
|
|
330
|
+ scroll(e) {
|
|
331
|
+ // 可以在这里添加滚动相关的逻辑
|
|
332
|
+ },
|
|
333
|
+ handleAdd() {
|
|
334
|
+ this.formData.useDate = parseTime(new Date(), '{y}-{m}-{d}');
|
|
335
|
+ this.$refs.addPopup.open()
|
|
336
|
+ },
|
|
337
|
+ closePopup() {
|
|
338
|
+ this.$refs.addPopup.close()
|
|
339
|
+ this.resetForm()
|
|
340
|
+ },
|
|
341
|
+ showProjectPicker() {
|
|
342
|
+ this.showPicker = true
|
|
343
|
+ },
|
|
344
|
+ showDevicePicker() {
|
|
345
|
+ this.openDevice = true
|
|
346
|
+ },
|
|
347
|
+ handleProjectSelect(project) {
|
|
348
|
+ this.selectedProject = project
|
|
349
|
+ },
|
|
350
|
+ handleDeviceSelect(device) {
|
|
351
|
+ this.selectDevice = device
|
|
352
|
+ },
|
|
353
|
+ openPowerOnPicker() {
|
|
354
|
+ this.$refs.powerOnPicker.open()
|
|
355
|
+ },
|
|
356
|
+ openPowerOffPicker() {
|
|
357
|
+ this.$refs.powerOffPicker.open()
|
|
358
|
+ },
|
|
359
|
+ handlePowerOnConfirm(e) {
|
|
360
|
+ this.formData.powerOn = e.value
|
|
361
|
+ },
|
|
362
|
+ handlePowerOffConfirm(e) {
|
|
363
|
+ this.formData.powerOff = e.value
|
|
364
|
+ },
|
|
365
|
+ confirmUseDate(e) {
|
|
366
|
+ this.formData.useDate = parseTime(e[0], '{y}-{m}-{d}')
|
|
367
|
+ },
|
|
368
|
+ formatDateTime(timestamp) {
|
|
369
|
+ if (!timestamp) return ''
|
|
370
|
+ const date = new Date(timestamp)
|
|
371
|
+ const year = date.getFullYear()
|
|
372
|
+ const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
373
|
+ const day = String(date.getDate()).padStart(2, '0')
|
|
374
|
+ const hours = String(date.getHours()).padStart(2, '0')
|
|
375
|
+ const minutes = String(date.getMinutes()).padStart(2, '0')
|
|
376
|
+ return `${year}-${month}-${day} ${hours}:${minutes}`
|
|
377
|
+ },
|
|
378
|
+ resetForm() {
|
|
379
|
+ this.isEdit = false
|
|
380
|
+ this.currentLogId = null
|
|
381
|
+ this.selectedProject = null
|
|
382
|
+ this.formData = {
|
|
383
|
+ useDate: '',
|
|
384
|
+ weather: '',
|
|
385
|
+ position: '',
|
|
386
|
+ dryTemperature: '',
|
|
387
|
+ wetTemperature: '',
|
|
388
|
+ airPressure: '',
|
|
389
|
+ heightType: '',
|
|
390
|
+ height: '',
|
|
391
|
+ powerOn: '',
|
|
392
|
+ powerOff: '',
|
|
393
|
+ usageType: ''
|
|
394
|
+ }
|
|
395
|
+ },
|
|
396
|
+ async submitForm() {
|
|
397
|
+ if (!this.selectDevice) {
|
|
398
|
+ uni.showToast({
|
|
399
|
+ title: '请选择设备',
|
|
400
|
+ icon: 'none'
|
|
401
|
+ })
|
|
402
|
+ return
|
|
403
|
+ }
|
|
404
|
+ const params = {
|
|
405
|
+ ...this.formData,
|
|
406
|
+ projectId: this.selectedProject ? this.selectedProject.projectId : null,
|
|
407
|
+ deviceId: this.selectDevice.deviceId,
|
|
408
|
+ userId: this.$store.getters.userId,
|
|
409
|
+ powerOn: Number(this.formData.powerOn),
|
|
410
|
+ powerOff: Number(this.formData.powerOff)
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ try {
|
|
414
|
+ if (this.isEdit) {
|
|
415
|
+ await updateDeviceLog({
|
|
416
|
+ ...params,
|
|
417
|
+ logId: this.currentLogId
|
|
418
|
+ })
|
|
419
|
+ uni.showToast({
|
|
420
|
+ title: '修改成功',
|
|
421
|
+ icon: 'success'
|
|
422
|
+ })
|
|
423
|
+ } else {
|
|
424
|
+ await addDeviceLog(params)
|
|
425
|
+ uni.showToast({
|
|
426
|
+ title: '添加成功',
|
|
427
|
+ icon: 'success'
|
|
428
|
+ })
|
|
429
|
+ }
|
|
430
|
+ this.closePopup()
|
|
431
|
+ this.getList()
|
|
432
|
+ } catch (error) {
|
|
433
|
+ uni.showToast({
|
|
434
|
+ title: this.isEdit ? '修改失败' : '添加失败',
|
|
435
|
+ icon: 'error'
|
|
436
|
+ })
|
|
437
|
+ }
|
|
438
|
+ },
|
|
439
|
+ handleEdit(item) {
|
|
440
|
+ this.isEdit = true
|
|
441
|
+ this.currentLogId = item.logId
|
|
442
|
+ this.selectedProject = item.project
|
|
443
|
+ this.selectDevice = item.device
|
|
444
|
+ this.formData = {
|
|
445
|
+ useDate: item.useDate,
|
|
446
|
+ weather: item.weather,
|
|
447
|
+ position: item.position,
|
|
448
|
+ dryTemperature: item.dryTemperature,
|
|
449
|
+ wetTemperature: item.wetTemperature,
|
|
450
|
+ airPressure: item.airPressure,
|
|
451
|
+ heightType: item.heightType,
|
|
452
|
+ height: item.height,
|
|
453
|
+ powerOn: item.powerOn,
|
|
454
|
+ powerOff: item.powerOff,
|
|
455
|
+ usageType: item.usageType
|
|
456
|
+ }
|
|
457
|
+ if (item.usageType === '全站仪') {
|
|
458
|
+ this.highTypeOptions = [
|
|
459
|
+ { text: '仪器高', value: '仪器高' },
|
|
460
|
+ { text: '棱镜高', value: '棱镜高' }
|
|
461
|
+ ]
|
|
462
|
+ } else if (item.usageType === 'GNSS基站' || item.usageType === 'GNSS静态') {
|
|
463
|
+ this.highTypeOptions = [
|
|
464
|
+ { text: '斜高', value: '斜高' },
|
|
465
|
+ { text: '直高', value: '直高' },
|
|
466
|
+ { text: '杆高', value: '杆高' },
|
|
467
|
+ { text: '天线高', value: '天线高' }
|
|
468
|
+ ]
|
|
469
|
+ }
|
|
470
|
+ this.$refs.addPopup.open()
|
|
471
|
+ },
|
|
472
|
+ async handleDelete(item) {
|
|
473
|
+ try {
|
|
474
|
+ const [err, res] = await uni.showModal({
|
|
475
|
+ title: '确认删除',
|
|
476
|
+ content: '确定要删除这条记录吗?',
|
|
477
|
+ confirmColor: '#FF3B30'
|
|
478
|
+ })
|
|
479
|
+
|
|
480
|
+ if (err || !res.confirm) {
|
|
481
|
+ return
|
|
482
|
+ }
|
|
483
|
+
|
|
484
|
+ await delDeviceLog(item.logId)
|
|
485
|
+ uni.showToast({
|
|
486
|
+ title: '删除成功',
|
|
487
|
+ icon: 'success'
|
|
488
|
+ })
|
|
489
|
+ this.getList()
|
|
490
|
+ } catch (error) {
|
|
491
|
+ uni.showToast({
|
|
492
|
+ title: '删除失败',
|
|
493
|
+ icon: 'error'
|
|
494
|
+ })
|
|
495
|
+ }
|
|
496
|
+ },
|
|
497
|
+ handleHighTypeChange(value) {
|
|
498
|
+ this.formData.heightType = value
|
|
499
|
+ },
|
|
500
|
+ handleUseTypeChange(value) {
|
|
501
|
+ this.formData.usageType = value
|
|
502
|
+ if (value === '全站仪') {
|
|
503
|
+ this.highTypeOptions = [
|
|
504
|
+ { text: '仪器高', value: '仪器高' },
|
|
505
|
+ { text: '棱镜高', value: '棱镜高' }
|
|
506
|
+ ]
|
|
507
|
+ } else if (value === 'GNSS基站' || value === 'GNSS静态') {
|
|
508
|
+ this.highTypeOptions = [
|
|
509
|
+ { text: '斜高', value: '斜高' },
|
|
510
|
+ { text: '直高', value: '直高' },
|
|
511
|
+ { text: '杆高', value: '杆高' },
|
|
512
|
+ { text: '天线高', value: '天线高' }
|
|
513
|
+ ]
|
|
514
|
+ }
|
|
515
|
+ this.formData.heightType = ''
|
|
516
|
+ },
|
|
517
|
+ async handleSearch() {
|
|
518
|
+ this.queryParams.pageNum = 1
|
|
519
|
+ const res = await listProject({
|
|
520
|
+ pageNum: 1,
|
|
521
|
+ pageSize: 10,
|
|
522
|
+ projectNumber: this.queryParams.projectNumber
|
|
523
|
+ })
|
|
524
|
+ let projectList = res.rows;
|
|
525
|
+ if (projectList.length == 1) {
|
|
526
|
+ this.queryParams.projectId = projectList[0].projectId
|
|
527
|
+ } else {
|
|
528
|
+ this.queryParams.projectId = null
|
|
529
|
+ }
|
|
530
|
+ this.getList()
|
|
531
|
+ },
|
|
532
|
+ clearSearch() {
|
|
533
|
+ this.queryParams.projectNumber = ''
|
|
534
|
+ this.queryParams.projectId = null
|
|
535
|
+ this.getList()
|
|
536
|
+ },
|
|
537
|
+ isOwnRecord(item) {
|
|
538
|
+ return item.user.userId === this.$store.getters.userId
|
|
539
|
+ }
|
|
540
|
+ }
|
|
541
|
+}
|
|
542
|
+</script>
|
|
543
|
+
|
|
544
|
+<style lang="scss" scoped>
|
|
545
|
+.scroll-Y {
|
|
546
|
+ height: 100vh;
|
|
547
|
+ background: #f8f8f8;
|
|
548
|
+ box-sizing: border-box;
|
|
549
|
+ position: relative;
|
|
550
|
+ padding-bottom: 120rpx;
|
|
551
|
+}
|
|
552
|
+
|
|
553
|
+.content-wrapper {
|
|
554
|
+ padding: 20rpx;
|
|
555
|
+ min-height: 100%;
|
|
556
|
+}
|
|
557
|
+
|
|
558
|
+.fab-button {
|
|
559
|
+ position: fixed;
|
|
560
|
+ right: 30rpx;
|
|
561
|
+ bottom: 50rpx;
|
|
562
|
+ width: 100rpx;
|
|
563
|
+ height: 100rpx;
|
|
564
|
+ background: #007AFF;
|
|
565
|
+ border-radius: 50%;
|
|
566
|
+ display: flex;
|
|
567
|
+ align-items: center;
|
|
568
|
+ justify-content: center;
|
|
569
|
+ box-shadow: 0 4rpx 16rpx rgba(0, 122, 255, 0.3);
|
|
570
|
+ z-index: 99;
|
|
571
|
+ transition: all 0.3s;
|
|
572
|
+
|
|
573
|
+ &:active {
|
|
574
|
+ transform: scale(0.95);
|
|
575
|
+ background: #0062cc;
|
|
576
|
+ }
|
|
577
|
+}
|
|
578
|
+
|
|
579
|
+.project-card {
|
|
580
|
+ margin-bottom: 20rpx;
|
|
581
|
+ background: #fff;
|
|
582
|
+ border-radius: 12rpx;
|
|
583
|
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
|
584
|
+
|
|
585
|
+ &:last-child {
|
|
586
|
+ margin-bottom: 0;
|
|
587
|
+ }
|
|
588
|
+
|
|
589
|
+ &-item {
|
|
590
|
+ padding: 20rpx;
|
|
591
|
+
|
|
592
|
+ &-header {
|
|
593
|
+ display: flex;
|
|
594
|
+ justify-content: space-between;
|
|
595
|
+ align-items: center;
|
|
596
|
+ margin-bottom: 20rpx;
|
|
597
|
+ padding-bottom: 20rpx;
|
|
598
|
+ border-bottom: 2rpx solid #f5f5f5;
|
|
599
|
+
|
|
600
|
+ .project-info {
|
|
601
|
+ display: flex;
|
|
602
|
+ align-items: center;
|
|
603
|
+ gap: 20rpx;
|
|
604
|
+
|
|
605
|
+ .project-number {
|
|
606
|
+ font-size: 28rpx;
|
|
607
|
+ color: #666;
|
|
608
|
+ background: #f5f5f5;
|
|
609
|
+ padding: 4rpx 16rpx;
|
|
610
|
+ border-radius: 8rpx;
|
|
611
|
+ }
|
|
612
|
+
|
|
613
|
+ .project-name {
|
|
614
|
+ font-size: 32rpx;
|
|
615
|
+ color: #333;
|
|
616
|
+ font-weight: bold;
|
|
617
|
+ }
|
|
618
|
+ }
|
|
619
|
+
|
|
620
|
+ .action-buttons {
|
|
621
|
+ display: flex;
|
|
622
|
+ gap: 16rpx;
|
|
623
|
+
|
|
624
|
+ .action-btn {
|
|
625
|
+ width: 64rpx;
|
|
626
|
+ height: 64rpx;
|
|
627
|
+ display: flex;
|
|
628
|
+ align-items: center;
|
|
629
|
+ justify-content: center;
|
|
630
|
+ background: #f8f8f8;
|
|
631
|
+ border: none;
|
|
632
|
+ border-radius: 8rpx;
|
|
633
|
+ padding: 0;
|
|
634
|
+ transition: all 0.3s;
|
|
635
|
+
|
|
636
|
+ &:active {
|
|
637
|
+ transform: scale(0.95);
|
|
638
|
+ }
|
|
639
|
+
|
|
640
|
+ &.edit {
|
|
641
|
+ &:active {
|
|
642
|
+ background: #e6f2ff;
|
|
643
|
+ }
|
|
644
|
+ }
|
|
645
|
+
|
|
646
|
+ &.delete {
|
|
647
|
+ &:active {
|
|
648
|
+ background: #ffe6e6;
|
|
649
|
+ }
|
|
650
|
+ }
|
|
651
|
+ }
|
|
652
|
+ }
|
|
653
|
+ }
|
|
654
|
+
|
|
655
|
+ &-content {
|
|
656
|
+ display: flex;
|
|
657
|
+ flex-direction: column;
|
|
658
|
+ gap: 12rpx;
|
|
659
|
+
|
|
660
|
+ .info-row {
|
|
661
|
+ display: flex;
|
|
662
|
+ align-items: center;
|
|
663
|
+ font-size: 26rpx;
|
|
664
|
+ line-height: 1.5;
|
|
665
|
+
|
|
666
|
+ .info-label {
|
|
667
|
+ color: #666;
|
|
668
|
+ width: 140rpx;
|
|
669
|
+ flex-shrink: 0;
|
|
670
|
+ }
|
|
671
|
+
|
|
672
|
+ .info-value {
|
|
673
|
+ color: #333;
|
|
674
|
+ flex: 1;
|
|
675
|
+ }
|
|
676
|
+ }
|
|
677
|
+ }
|
|
678
|
+ }
|
|
679
|
+}
|
|
680
|
+
|
|
681
|
+.empty-state {
|
|
682
|
+ display: flex;
|
|
683
|
+ flex-direction: column;
|
|
684
|
+ align-items: center;
|
|
685
|
+ justify-content: center;
|
|
686
|
+ padding: 120rpx 0;
|
|
687
|
+
|
|
688
|
+ .empty-image {
|
|
689
|
+ width: 240rpx;
|
|
690
|
+ height: 240rpx;
|
|
691
|
+ margin-bottom: 20rpx;
|
|
692
|
+ }
|
|
693
|
+
|
|
694
|
+ .empty-text {
|
|
695
|
+ font-size: 28rpx;
|
|
696
|
+ color: #999;
|
|
697
|
+ }
|
|
698
|
+}
|
|
699
|
+
|
|
700
|
+.popup-content {
|
|
701
|
+ background: #fff;
|
|
702
|
+ border-radius: 24rpx;
|
|
703
|
+ width: 680rpx;
|
|
704
|
+ max-height: 75vh;
|
|
705
|
+
|
|
706
|
+ .popup-header {
|
|
707
|
+ display: flex;
|
|
708
|
+ justify-content: space-between;
|
|
709
|
+ align-items: center;
|
|
710
|
+ padding: 30rpx;
|
|
711
|
+ background: #f8f8f8;
|
|
712
|
+
|
|
713
|
+ .title {
|
|
714
|
+ font-size: 34rpx;
|
|
715
|
+ font-weight: 600;
|
|
716
|
+ color: #333;
|
|
717
|
+ }
|
|
718
|
+ }
|
|
719
|
+
|
|
720
|
+ .popup-body {
|
|
721
|
+ padding: 30rpx;
|
|
722
|
+ max-height: 60vh;
|
|
723
|
+ overflow-y: auto;
|
|
724
|
+
|
|
725
|
+ .form-item {
|
|
726
|
+ margin-bottom: 30rpx;
|
|
727
|
+
|
|
728
|
+ .label {
|
|
729
|
+ display: block;
|
|
730
|
+ font-size: 28rpx;
|
|
731
|
+ color: #333;
|
|
732
|
+ margin-bottom: 16rpx;
|
|
733
|
+ font-weight: 500;
|
|
734
|
+ }
|
|
735
|
+
|
|
736
|
+ input {
|
|
737
|
+ width: 100%;
|
|
738
|
+ height: 88rpx;
|
|
739
|
+ background: #f8f8f8;
|
|
740
|
+ border: 2rpx solid #eee;
|
|
741
|
+ border-radius: 12rpx;
|
|
742
|
+ padding: 0 24rpx;
|
|
743
|
+ font-size: 28rpx;
|
|
744
|
+ color: #333;
|
|
745
|
+ transition: all 0.3s;
|
|
746
|
+
|
|
747
|
+ &:focus {
|
|
748
|
+ border-color: #007AFF;
|
|
749
|
+ background: #fff;
|
|
750
|
+ }
|
|
751
|
+
|
|
752
|
+ &::placeholder {
|
|
753
|
+ color: #999;
|
|
754
|
+ }
|
|
755
|
+ }
|
|
756
|
+
|
|
757
|
+ .project-picker {
|
|
758
|
+ width: 100%;
|
|
759
|
+ height: 88rpx;
|
|
760
|
+ background: #f8f8f8;
|
|
761
|
+ border: 2rpx solid #eee;
|
|
762
|
+ border-radius: 12rpx;
|
|
763
|
+ padding: 0 24rpx;
|
|
764
|
+ display: flex;
|
|
765
|
+ align-items: center;
|
|
766
|
+ transition: all 0.3s;
|
|
767
|
+
|
|
768
|
+ &:active {
|
|
769
|
+ background: #f0f0f0;
|
|
770
|
+ }
|
|
771
|
+
|
|
772
|
+ .placeholder {
|
|
773
|
+ color: #999;
|
|
774
|
+ font-size: 28rpx;
|
|
775
|
+ }
|
|
776
|
+ }
|
|
777
|
+
|
|
778
|
+ .datetime-picker {
|
|
779
|
+ width: 100%;
|
|
780
|
+ height: 88rpx;
|
|
781
|
+ background: #f8f8f8;
|
|
782
|
+ border: 2rpx solid #eee;
|
|
783
|
+ border-radius: 12rpx;
|
|
784
|
+ padding: 0 24rpx;
|
|
785
|
+ display: flex;
|
|
786
|
+ align-items: center;
|
|
787
|
+ transition: all 0.3s;
|
|
788
|
+
|
|
789
|
+ &:active {
|
|
790
|
+ background: #f0f0f0;
|
|
791
|
+ }
|
|
792
|
+
|
|
793
|
+ .placeholder {
|
|
794
|
+ color: #999;
|
|
795
|
+ font-size: 28rpx;
|
|
796
|
+ }
|
|
797
|
+ }
|
|
798
|
+ }
|
|
799
|
+ }
|
|
800
|
+
|
|
801
|
+ .popup-footer {
|
|
802
|
+ display: flex;
|
|
803
|
+ gap: 24rpx;
|
|
804
|
+ padding: 30rpx;
|
|
805
|
+ background: #f8f8f8;
|
|
806
|
+ border-top: 2rpx solid #eee;
|
|
807
|
+
|
|
808
|
+ .btn {
|
|
809
|
+ flex: 1;
|
|
810
|
+ height: 88rpx;
|
|
811
|
+ line-height: 88rpx;
|
|
812
|
+ text-align: center;
|
|
813
|
+ border-radius: 12rpx;
|
|
814
|
+ font-size: 30rpx;
|
|
815
|
+ font-weight: 500;
|
|
816
|
+ transition: all 0.3s;
|
|
817
|
+
|
|
818
|
+ &.cancel {
|
|
819
|
+ background: #f0f0f0;
|
|
820
|
+ color: #666;
|
|
821
|
+
|
|
822
|
+ &:active {
|
|
823
|
+ background: #e0e0e0;
|
|
824
|
+ }
|
|
825
|
+ }
|
|
826
|
+
|
|
827
|
+ &.confirm {
|
|
828
|
+ background: #007AFF;
|
|
829
|
+ color: #fff;
|
|
830
|
+
|
|
831
|
+ &:active {
|
|
832
|
+ background: #0062cc;
|
|
833
|
+ }
|
|
834
|
+ }
|
|
835
|
+ }
|
|
836
|
+ }
|
|
837
|
+}
|
|
838
|
+
|
|
839
|
+.weather-select {
|
|
840
|
+ :deep(.uni-data-select) {
|
|
841
|
+ .uni-select {
|
|
842
|
+ height: 88rpx;
|
|
843
|
+ background: #f8f8f8;
|
|
844
|
+ border: 2rpx solid #eee;
|
|
845
|
+ border-radius: 12rpx;
|
|
846
|
+
|
|
847
|
+ .uni-select__input-box {
|
|
848
|
+ height: 88rpx;
|
|
849
|
+ line-height: 88rpx;
|
|
850
|
+ padding: 0 24rpx;
|
|
851
|
+ }
|
|
852
|
+
|
|
853
|
+ .uni-select__input-text {
|
|
854
|
+ font-size: 28rpx;
|
|
855
|
+ color: #333;
|
|
856
|
+ }
|
|
857
|
+
|
|
858
|
+ .uni-select__input-placeholder {
|
|
859
|
+ color: #999;
|
|
860
|
+ }
|
|
861
|
+ }
|
|
862
|
+ }
|
|
863
|
+}
|
|
864
|
+
|
|
865
|
+:deep(.uni-date) {
|
|
866
|
+ .uni-date__icon-clear {
|
|
867
|
+ display: none;
|
|
868
|
+ }
|
|
869
|
+
|
|
870
|
+ .uni-date-editor {
|
|
871
|
+ height: 88rpx;
|
|
872
|
+ background: #f8f8f8;
|
|
873
|
+ border: 2rpx solid #eee;
|
|
874
|
+ border-radius: 12rpx;
|
|
875
|
+
|
|
876
|
+ .uni-date__input {
|
|
877
|
+ height: 88rpx;
|
|
878
|
+ line-height: 88rpx;
|
|
879
|
+ font-size: 28rpx;
|
|
880
|
+ color: #333;
|
|
881
|
+ }
|
|
882
|
+ }
|
|
883
|
+}
|
|
884
|
+
|
|
885
|
+.loading-more,
|
|
886
|
+.no-more {
|
|
887
|
+ text-align: center;
|
|
888
|
+ padding: 20rpx 0;
|
|
889
|
+ margin-bottom: 120rpx;
|
|
890
|
+
|
|
891
|
+ .loading-text,
|
|
892
|
+ .no-more-text {
|
|
893
|
+ font-size: 24rpx;
|
|
894
|
+ color: #999;
|
|
895
|
+ }
|
|
896
|
+}
|
|
897
|
+
|
|
898
|
+.search-bar {
|
|
899
|
+ padding: 20rpx;
|
|
900
|
+ background: #fff;
|
|
901
|
+ margin-bottom: 20rpx;
|
|
902
|
+ border-radius: 12rpx;
|
|
903
|
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
|
|
904
|
+
|
|
905
|
+ .search-input-wrapper {
|
|
906
|
+ display: flex;
|
|
907
|
+ align-items: center;
|
|
908
|
+ background: #f8f8f8;
|
|
909
|
+ border-radius: 8rpx;
|
|
910
|
+ padding: 0 20rpx;
|
|
911
|
+ height: 72rpx;
|
|
912
|
+
|
|
913
|
+ .search-input {
|
|
914
|
+ flex: 1;
|
|
915
|
+ height: 72rpx;
|
|
916
|
+ margin: 0 20rpx;
|
|
917
|
+ font-size: 28rpx;
|
|
918
|
+ color: #333;
|
|
919
|
+
|
|
920
|
+ &::placeholder {
|
|
921
|
+ color: #999;
|
|
922
|
+ }
|
|
923
|
+ }
|
|
924
|
+ }
|
|
925
|
+}
|
|
926
|
+</style>
|