d56bd957
“wangming”
修复问题,组建AI
|
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
<template>
<view class="main">
<view class="toptitle">
<view class="toptitle_left" @click="ht">
<u-icon name="arrow-left" color="#fff" size="20"></u-icon>
</view>
<view class="toptitle_title">
反馈列表
</view>
</view>
<view class="" style="padding: 10px;background-color: #fff;border-radius: 5px;margin-bottom: 10px;">
<u-subsection :list="list" fontSize="14" activeColor="#0052D8" :current="current"
@change='change'></u-subsection>
</view>
<view class="">
<view v-if="current == 0 && hqsbwkfklist.length === 0" style="text-align: center; padding: 40px 20px; color: #999;">
<text>暂无设备问题反馈</text>
</view>
<view class="" v-if="current == 0">
<view
style="border: 1px solid #e5e5e5;padding: 20rpx;border-radius: 10rpx;background-color: #fff;margin-bottom: 20rpx;cursor: pointer;"
class="feedback-item"
v-for="item in hqsbwkfklist"
:key="item.id"
@click.stop="viewDetail(item, 'sbwtfk')"
>
<view class="" style="display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #e5e5e5;padding: 20rpx;">
<span>设备名</span>
<span>{{item.title}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;border-bottom: 1px solid #e5e5e5;">
<span>故障信息</span>
<span style="flex: 1; text-align: right; margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{item.nr == null ? "暂无" : item.nr}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;border-bottom: 1px solid #e5e5e5;">
<span>提交时间</span>
<span>{{timestampToTime(item.fbsj)}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;border-bottom: 1px solid #e5e5e5;">
<span>处理状态</span>
<span :style="{ color: getStatusColor(item.cljg) }">{{item.cljg == null ? '未处理' : item.cljg}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;">
<span>反馈结果</span>
<span style="flex: 1; text-align: right; margin-left: 10px;">{{item.fkjg == null ? '暂无反馈' : item.fkjg}}</span>
</view>
<view v-if="(item.fj1 && item.fj1.length > 0) || (item.fj2 && item.fj2.length > 0)" style="padding: 10rpx 20rpx; border-top: 1px solid #e5e5e5;">
<text style="font-size: 12px; color: #999;">点击查看详情(含附件和图片)</text>
</view>
</view>
</view>
<view v-if="current == 1 && hqxtwtfklist.length === 0" style="text-align: center; padding: 40px 20px; color: #999;">
<text>暂无系统问题反馈</text>
</view>
<view class="" v-if="current == 1">
<view
style="border: 1px solid #e5e5e5;padding: 20rpx;border-radius: 10rpx;background-color: #fff;margin-bottom: 20rpx;cursor: pointer;"
class="feedback-item"
v-for="item in hqxtwtfklist"
:key="item.id"
@click.stop="viewDetail(item, 'xtwtfk')"
>
<view class="" style="display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #e5e5e5;padding: 20rpx;">
<span>问题分类</span>
<span>{{item.qxgn || '无'}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #e5e5e5;padding: 20rpx;">
<span>问题描述</span>
<span style="flex: 1; text-align: right; margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{item.nr}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;border-bottom: 1px solid #e5e5e5;">
<span>提交时间</span>
<span>{{timestampToTime(item.fbsj)}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;border-bottom: 1px solid #e5e5e5;">
<span>处理状态</span>
<span :style="{ color: getStatusColor(item.cljg) }">{{item.cljg == null ? '未处理' : item.cljg}}</span>
</view>
<view class="" style="display: flex;justify-content: space-between;align-items: center;padding: 20rpx;">
<span>反馈结果</span>
<span style="flex: 1; text-align: right; margin-left: 10px;">{{item.fkjg == null ? '暂无反馈' : item.fkjg}}</span>
</view>
<view v-if="(item.fj1 && item.fj1.length > 0) || (item.fj2 && item.fj2.length > 0)" style="padding: 10rpx 20rpx; border-top: 1px solid #e5e5e5;">
<text style="font-size: 12px; color: #999;">点击查看详情(含附件和图片)</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: ['设备问题反馈','系统问题反馈'],
current: 0,
title: "关键词",
hqxtwtfklist:[],
hqsbwkfklist:[],
}
},
onLoad() {
this.hqxtwtfk();
this.hqsbwkfk();
},
methods: {
// 查看详情
viewDetail(item, type) {
console.log('点击查看详情:', item, type);
if (!item || !item.id) {
uni.showToast({
title: '数据异常,无法查看详情',
icon: 'none'
});
return;
}
try {
// 确保附件数据是数组格式
const detailData = {
...item,
type: type // 'sbwtfk' 或 'xtwtfk'
};
// 处理附件数据
if (!Array.isArray(detailData.fj1)) {
if (typeof detailData.fj1 === 'string' && detailData.fj1) {
try {
detailData.fj1 = JSON.parse(detailData.fj1);
} catch (e) {
console.warn('解析 fj1 失败:', e);
detailData.fj1 = [];
}
} else {
detailData.fj1 = [];
}
}
if (!Array.isArray(detailData.fj2)) {
if (typeof detailData.fj2 === 'string' && detailData.fj2) {
try {
detailData.fj2 = JSON.parse(detailData.fj2);
} catch (e) {
console.warn('解析 fj2 失败:', e);
detailData.fj2 = [];
}
} else {
detailData.fj2 = [];
}
}
console.log('准备传递的详情数据:', detailData);
console.log('fj1(视频)数量:', detailData.fj1 ? detailData.fj1.length : 0);
console.log('fj2(图片)数量:', detailData.fj2 ? detailData.fj2.length : 0);
// 保存详情数据到本地存储
uni.setStorageSync('fkDetail', JSON.stringify(detailData));
console.log('数据已保存,准备跳转到详情页');
uni.navigateTo({
url: '/pages/new/yhfk/detail',
success: () => {
console.log('跳转成功');
},
fail: (err) => {
console.error('跳转失败:', err);
uni.showToast({
title: '跳转失败,请检查页面配置',
icon: 'none'
});
}
});
} catch (e) {
console.error('保存数据失败:', e);
uni.showToast({
title: '保存数据失败',
icon: 'none'
});
}
},
// 获取处理状态颜色
getStatusColor(cljg) {
if (!cljg) return '#999';
if (cljg.includes('已处理')) return '#67C23A';
if (cljg.includes('进行中')) return '#E6A23C';
if (cljg.includes('未处理')) return '#F56C6C';
return '#999';
},
// 更新系统问题已读(延迟执行,避免影响列表显示)
gxxtwtyd(){
// 延迟更新已读状态,避免影响列表显示
setTimeout(() => {
if(this.hqxtwtfklist.length > 0){
for(let i = 0;i < this.hqxtwtfklist.length;i++){
this.API.gxxtwtyd(this.hqxtwtfklist[i]).then(res=>{
console.log('更新系统问题已读',res);
}).catch(err => {
console.error('更新系统问题已读失败:', err);
});
}
}
}, 500);
},
// 更新设备问题已读(延迟执行,避免影响列表显示)
gxsbwtyd(){
// 延迟更新已读状态,避免影响列表显示
setTimeout(() => {
if(this.hqsbwkfklist.length > 0){
for(let i = 0;i < this.hqsbwkfklist.length;i++){
this.API.gxsbwtyd(this.hqsbwkfklist[i]).then(res=>{
console.log('更新设备问题已读',res);
}).catch(err => {
console.error('更新设备问题已读失败:', err);
});
}
}
}, 500);
},
ht(){
uni.navigateBack({
delta:1
})
},
timestampToTime(timestamp) {
console.log("timestamp",timestamp);
const date = new Date(timestamp); //时间戳为10位需*1000,13位不需乘
const Y = date.getFullYear() + '-';
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
const s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Y + M + D + h + m + s;
},
change(e) {
this.current = e
console.log('this.current',this.current);
if(e == 1){
this.gxxtwtyd();
}else{
this.gxsbwtyd();
}
},
// 获取系统问题反馈
hqxtwtfk(){
this.API.hqdqdlrxx().then(res=>{
console.log("用户信息",res);
var info = {
currentPage:1,
pageSize:100,
fbr:res.data.userInfo.userId
}
this.API.hqxtwtfk(info).then(res1=>{
console.log("获取系统问题反馈",res1);
if(res1 && res1.data && res1.data.list){
this.hqxtwtfklist = res1.data.list || [];
// 延迟更新已读,避免影响列表显示
this.gxxtwtyd();
} else {
this.hqxtwtfklist = [];
}
}).catch(err => {
console.error("获取系统问题反馈失败:", err);
this.hqxtwtfklist = [];
});
}).catch(err => {
console.error("获取用户信息失败:", err);
this.hqxtwtfklist = [];
});
},
// 获取设备问题
hqsbwkfk(){
this.API.hqdqdlrxx().then(res=>{
console.log("用户信息",res);
var info = {
currentPage:1,
pageSize:100,
fbr:res.data.userInfo.userId
}
this.API.hqsbwkfk(info).then(res1=>{
console.log("获取设备问题反馈",res1);
if(res1 && res1.data && res1.data.list){
this.hqsbwkfklist = res1.data.list || [];
// 延迟更新已读,避免影响列表显示
this.gxsbwtyd();
} else {
this.hqsbwkfklist = [];
}
}).catch(err => {
console.error("获取设备问题反馈失败:", err);
this.hqsbwkfklist = [];
});
}).catch(err => {
console.error("获取用户信息失败:", err);
this.hqsbwkfklist = [];
});
},
}
}
</script>
<style scoped lang="scss">
@import 'index.scss';
.u-subsection--button {
height: 50px;
}
.feedback-item {
transition: all 0.3s;
&:active {
background-color: #f5f5f5;
transform: scale(0.98);
}
}
</style>
|