Commit afb61f3251152b62672cc96c1f5d29a40532f11a

Authored by fengwotao
1 parent de261607

pref:命令记录新增响应类型 和响应失败内容显示 调整部分样式

@@ -33,17 +33,24 @@ @@ -33,17 +33,24 @@
33 </view> 33 </view>
34 <u-line length="90%" margin="0 auto"></u-line> 34 <u-line length="90%" margin="0 auto"></u-line>
35 <view class="detail-item"> 35 <view class="detail-item">
36 - <view class="detail-label">下发结果</view>  
37 - <view class="detail-value">{{ commandDetail.status === 'SUCCESSFUL' ? '成功' : '失败' }}</view> 36 + <view class="detail-label">命令状态</view>
  37 + <view class="detail-value">{{ commandDetail.statusName }}</view>
38 </view> 38 </view>
39 <u-line length="90%" margin="0 auto"></u-line> 39 <u-line length="90%" margin="0 auto"></u-line>
40 <view class="detail-item" v-if="!commandDetail.request.oneway"> 40 <view class="detail-item" v-if="!commandDetail.request.oneway">
41 <view class="detail-label">响应结果</view> 41 <view class="detail-label">响应结果</view>
42 - <view class="detail-value">{{ commandDetail.response ? '成功' : '失败' }}</view> 42 + <view class="detail-value">{{ commandDetail.response.status==='SUCCESS' ? '成功' : '失败' }}</view>
  43 + </view>
  44 + <view class="detail-item" v-if="!commandDetail.request.oneway">
  45 + <view class="detail-label">响应失败内容</view>
  46 + <view class="detail-value" style="width: 400rpx;" v-if="commandDetail.response.status!=='SUCCESS'">
  47 + <u--textarea placeholder="响应失败内容" v-model="failContent" />
  48 + </view>
43 </view> 49 </view>
44 </view> 50 </view>
45 <view class="command">命令内容</view> 51 <view class="command">命令内容</view>
46 <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea> 52 <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea>
  53 + <view style="height: 50rpx;"></view>
47 </view> 54 </view>
48 </template> 55 </template>
49 56
@@ -54,7 +61,8 @@ @@ -54,7 +61,8 @@
54 export default { 61 export default {
55 data() { 62 data() {
56 return { 63 return {
57 - commandDetail: {} 64 + commandDetail: {},
  65 + failContent: ""
58 }; 66 };
59 }, 67 },
60 computed: { 68 computed: {
@@ -85,7 +93,6 @@ @@ -85,7 +93,6 @@
85 } catch (e) { 93 } catch (e) {
86 console.error("命令记录页面格式化无返回值", e); 94 console.error("命令记录页面格式化无返回值", e);
87 } 95 }
88 -  
89 } 96 }
90 }, 97 },
91 onLoad(options) { 98 onLoad(options) {
@@ -93,6 +100,8 @@ @@ -93,6 +100,8 @@
93 data 100 data
94 } = options; 101 } = options;
95 this.commandDetail = JSON.parse(data); 102 this.commandDetail = JSON.parse(data);
  103 + if (this.commandDetail.response.status === 'SUCCESS') return
  104 + this.failContent = JSON.stringify(this.commandDetail.response.error)
96 } 105 }
97 }; 106 };
98 </script> 107 </script>
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <view class="item-first"> 14 <view class="item-first">
15 <text>{{ item.deviceName }}</text> 15 <text>{{ item.deviceName }}</text>
16 <view v-if="!item.request.oneway"> 16 <view v-if="!item.request.oneway">
17 - <view class="item-right item-success" v-if="item.response">响应成功</view> 17 + <view class="item-right item-success" v-if="item.response.status==='SUCCESS'">响应成功</view>
18 <view class="item-right item-fail" v-else>响应失败</view> 18 <view class="item-right item-fail" v-else>响应失败</view>
19 </view> 19 </view>
20 </view> 20 </view>