Commit afb61f3251152b62672cc96c1f5d29a40532f11a

Authored by fengwotao
1 parent de261607

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

... ... @@ -33,17 +33,24 @@
33 33 </view>
34 34 <u-line length="90%" margin="0 auto"></u-line>
35 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 38 </view>
39 39 <u-line length="90%" margin="0 auto"></u-line>
40 40 <view class="detail-item" v-if="!commandDetail.request.oneway">
41 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 49 </view>
44 50 </view>
45 51 <view class="command">命令内容</view>
46 52 <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea>
  53 + <view style="height: 50rpx;"></view>
47 54 </view>
48 55 </template>
49 56
... ... @@ -54,7 +61,8 @@
54 61 export default {
55 62 data() {
56 63 return {
57   - commandDetail: {}
  64 + commandDetail: {},
  65 + failContent: ""
58 66 };
59 67 },
60 68 computed: {
... ... @@ -85,7 +93,6 @@
85 93 } catch (e) {
86 94 console.error("命令记录页面格式化无返回值", e);
87 95 }
88   -
89 96 }
90 97 },
91 98 onLoad(options) {
... ... @@ -93,6 +100,8 @@
93 100 data
94 101 } = options;
95 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 107 </script>
... ...
... ... @@ -14,7 +14,7 @@
14 14 <view class="item-first">
15 15 <text>{{ item.deviceName }}</text>
16 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 18 <view class="item-right item-fail" v-else>响应失败</view>
19 19 </view>
20 20 </view>
... ...