Commit 15e18f7f95d81413e53069889c3e84ac1f823d97

Authored by fengwotao
1 parent b61a66a9

pref: app、mp端 优化代码

@@ -193,7 +193,7 @@ @@ -193,7 +193,7 @@
193 .identifier === e[curr].key) 193 .identifier === e[curr].key)
194 acc.push( 194 acc.push(
195 `${findAttribute.name}:${e[curr].realValue}${findAttribute.detail?.dataType?.specs?.unit?.key}` 195 `${findAttribute.name}:${e[curr].realValue}${findAttribute.detail?.dataType?.specs?.unit?.key}`
196 - ) 196 + )
197 } 197 }
198 })) 198 }))
199 return acc 199 return acc
@@ -214,11 +214,14 @@ @@ -214,11 +214,14 @@
214 const findOperation = operation.find(findItem => findItem.value === item.login)?.symbol 214 const findOperation = operation.find(findItem => findItem.value === item.login)?.symbol
215 return findOperation + item.logicValue 215 return findOperation + item.logicValue
216 }) 216 })
217 - this.formatAlarmConditionText = format 217 + this.formatAlarmConditionText = format.filter(Boolean).join(',')
  218 + console.log(this.formatAlarmConditionText);
218 }, 219 },
219 async formatAlarmDevice(e) { 220 async formatAlarmDevice(e) {
220 const keys = Object.keys(e) 221 const keys = Object.keys(e)
221 const dataFormat = await this.handleAlarmDetailFormat(keys); 222 const dataFormat = await this.handleAlarmDetailFormat(keys);
  223 + if (!dataFormat) this.formatDeviceText = ''
  224 + if (Array.isArray(dataFormat) && dataFormat.length === 0) this.formatDeviceText = ''
222 this.formatDeviceText = dataFormat.map(item => item.name).join(',') 225 this.formatDeviceText = dataFormat.map(item => item.name).join(',')
223 }, 226 },
224 async handleAlarmDetailFormat(keys) { 227 async handleAlarmDetailFormat(keys) {
@@ -32,13 +32,12 @@ @@ -32,13 +32,12 @@
32 export default { 32 export default {
33 props: { 33 props: {
34 total: Number, 34 total: Number,
35 - totalText:[Number,String] 35 + totalText: [Number, String]
36 } 36 }
37 } 37 }
38 </script> 38 </script>
39 39
40 <style lang="scss" scoped> 40 <style lang="scss" scoped>
41 -  
42 /deep/ .u-button--primary { 41 /deep/ .u-button--primary {
43 background-color: #377dff !important; 42 background-color: #377dff !important;
44 border-color: #377dff !important; 43 border-color: #377dff !important;
1 -<template>  
2 - <view class="w-100 modal-content">  
3 - <view class="header-title">命令下发</view>  
4 - <view class="u-flex">  
5 - <text class="type-text">下发类型:</text>  
6 - <u-radio-group v-model="commandType" placement="row">  
7 - <u-radio activeColor="#3388FF" label="单向" name="OneWay"></u-radio>  
8 - <view style="margin: 0 20rpx;"></view>  
9 - <u-radio activeColor="#3388FF" label="双向" name="TwoWay"></u-radio>  
10 - </u-radio-group>  
11 - </view>  
12 - <view class="content-body">  
13 - <div class="u-flex u-row-between">  
14 - <u--textarea :placeholder="`请输入下发内容${isShowTCP?'(字符串格式)':'(json格式)'}`"  
15 - v-model="inputCommandVal" />  
16 - <u-icon v-if="!isShowTCP" @click="handleCopy(copyTextValue)" name="question-circle"  
17 - color="#2979ff" size="28" class="ml-10">  
18 - </u-icon>  
19 -  
20 - </div>  
21 - </view>  
22 - <view class="button-group">  
23 - <view>  
24 - <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="取消"  
25 - @click="cancelCommand"></u-button>  
26 - </view>  
27 - <view>  
28 - <u-button color="#3388ff" shape="circle" text="确认" @click="confirmCommand"></u-button>  
29 - </view>  
30 - </view>  
31 - </view>  
32 -</template>  
33 -  
34 -<script>  
35 - import {  
36 - useShowModal  
37 - } from '@/plugins/utils.js'  
38 -  
39 - export default {  
40 - props: {  
41 - isShowTCP: Boolean  
42 - },  
43 - data() {  
44 - return {  
45 - current: 0,  
46 - commandType: 'OneWay',  
47 - inputCommandVal: '',  
48 - copyTextValue: {  
49 - "method": "methodThingskit",  
50 - "params": {  
51 - "pin": 7,  
52 - "value": 1  
53 - }  
54 - }  
55 - }  
56 - },  
57 - methods: {  
58 - cancelCommand() {  
59 - this.$emit('cancelCommand')  
60 - },  
61 - confirmCommand() {  
62 - this.$emit('confirmCommand', this.commandType, this.inputCommandVal)  
63 - },  
64 - handleCopy(value) {  
65 - useShowModal(JSON.stringify(value), '命令下发', '复制内容').then(res => {  
66 - uni.setClipboardData({  
67 - data: JSON.stringify(value),  
68 - success: () => {  
69 - uni.showToast({  
70 - title: '复制成功'  
71 - })  
72 - }  
73 - });  
74 - })  
75 - }  
76 - }  
77 - }  
78 -</script>  
79 -  
80 -<style lang="scss" scoped>  
81 - .modal-content {  
82 - width: 720rpx;  
83 - padding: 0 30rpx;  
84 - background-color: white;  
85 -  
86 - .header-title {  
87 - text-align: center;  
88 - font-weight: 700;  
89 - margin-bottom: 40rpx;  
90 - }  
91 -  
92 - .type-text {  
93 - color: #333;  
94 - font-size: 14px;  
95 - font-weight: 700;  
96 - margin-right: 30rpx;  
97 - }  
98 -  
99 - .content-body {  
100 - margin-top: 28rpx;  
101 - width: 100%;  
102 - }  
103 -  
104 - .button-group {  
105 - display: flex;  
106 - margin-top: 40rpx;  
107 - justify-content: space-between;  
108 -  
109 - view {  
110 - width: 300rpx;  
111 - }  
112 - }  
113 - }  
114 -</style>  
@@ -6,7 +6,8 @@ @@ -6,7 +6,8 @@
6 <view class="basic-header"> 6 <view class="basic-header">
7 <view class="u-flex"> 7 <view class="u-flex">
8 <view class="pl-3"> 8 <view class="pl-3">
9 - <u-icon v-if="deviceDetail.deviceInfo.longitude !== ''" @click="handleClick" name="map-fill"></u-icon> 9 + <u-icon v-if="deviceDetail.deviceInfo.longitude !== ''" @click="handleClick"
  10 + name="map-fill"></u-icon>
10 </view> 11 </view>
11 <view class="basic-text text-clip ml-2"> 12 <view class="basic-text text-clip ml-2">
12 {{ deviceDetail.alias ? deviceDetail.alias : deviceDetail.name }} 13 {{ deviceDetail.alias ? deviceDetail.alias : deviceDetail.name }}
@@ -16,13 +17,12 @@ @@ -16,13 +17,12 @@
16 </view> 17 </view>
17 </view> 18 </view>
18 <!-- 命令下发 设备在线并且不是网关子设备 --> 19 <!-- 命令下发 设备在线并且不是网关子设备 -->
19 - <!-- v-if="deviceDetail.deviceState === 'ONLINE' && deviceDetail.deviceType !== 'SENSOR'" -->  
20 - <view class="mr-2"> 20 + <view class="mr-2" v-if="deviceDetail.deviceState === 'ONLINE' && deviceDetail.deviceType !== 'SENSOR'">
21 <!-- #ifdef MP --> 21 <!-- #ifdef MP -->
22 <u-button type="primary" shape="circle" size="mini" text="下发命令" @click="handleMpShowModal" /> 22 <u-button type="primary" shape="circle" size="mini" text="下发命令" @click="handleMpShowModal" />
23 <!-- #endif --> 23 <!-- #endif -->
24 <!-- #ifdef APP-PLUS --> 24 <!-- #ifdef APP-PLUS -->
25 - <view @tap="handleAppShowModal" data-target="Modal"> 25 + <view class="cu-item" @tap="handleAppShowModal" data-target="Modal">
26 <text>下发命令</text> 26 <text>下发命令</text>
27 </view> 27 </view>
28 <!-- #endif --> 28 <!-- #endif -->
@@ -62,108 +62,196 @@ @@ -62,108 +62,196 @@
62 </view> 62 </view>
63 <!-- 命令下发 --> 63 <!-- 命令下发 -->
64 <!-- #ifdef APP-PLUS --> 64 <!-- #ifdef APP-PLUS -->
65 - <!-- 原生弹窗 --> 65 + <!-- 原生弹窗 封装成子组件无效 -->
66 <view class="cu-modal" :class="modalName == 'Modal' ? 'show' : ''"> 66 <view class="cu-modal" :class="modalName == 'Modal' ? 'show' : ''">
67 - <view class="cu-dialog" style="padding: 300rpx 0 70rpx">  
68 - <app-command-issuance :isShowTCP="isShowTCP" @hideModal="hideMpModal" @cancelCommand="cancelCommand" @confirmCommand="confirmCommand"></app-command-issuance> 67 + <view class="cu-dialog">
  68 + <view class="app-command-content">
  69 + <view class="app-command-text">
  70 + <text>命令下发</text>
  71 + </view>
  72 + <view class="app-command-type">
  73 + <text>下发类型</text>
  74 + <view class="mr-2">
  75 + <radio-group @change="radioChange" class="flex mr-1">
  76 + <label v-for="(item, index) in commandTypeList" :key="item.value">
  77 + <view class="flex">
  78 + <view class="ml-1">
  79 + <radio :value="item.value" :checked="index === current" />
  80 + </view>
  81 + <view style="width:10rpx"></view>
  82 + <view class="ml-1">{{item.name}}</view>
  83 + </view>
  84 + </label>
  85 + </radio-group>
  86 + </view>
  87 + </view>
  88 + <view class="app-command-body">
  89 + <textarea class="app-command-textarea" v-model="inputCommandContent"
  90 + :placeholder="`请输入下发内容${isShowTCP?'(字符串格式)':'(json格式)'}`" />
  91 + <u-icon @click="handleCopy(copyTextValue)" v-if="!isShowTCP" name="question-circle"
  92 + color="#2979ff" size="28" class="ml-10">
  93 + </u-icon>
  94 + </view>
  95 + <view class="app-command-buttons">
  96 + <view class="cancel-button" @click="cancelCommand"><text class="cancel-text">取消</text></view>
  97 + <view @click="handleAppCommand" class="confrim-button"><text class="confrim-text">确认</text>
  98 + </view>
  99 + </view>
  100 + </view>
69 </view> 101 </view>
70 </view> 102 </view>
71 <!-- #endif --> 103 <!-- #endif -->
72 <!-- #ifdef MP --> 104 <!-- #ifdef MP -->
73 - <!-- u-modal在app端弹窗层级无法覆盖 -->  
74 - <mp-command-issuance  
75 - :isShowTCP="isShowTCP"  
76 - :showModal="mpShowModal"  
77 - @hideModal="hideMpModal"  
78 - @cancelCommand="cancelCommand"  
79 - @confirmCommand="confirmCommand"  
80 - ></mp-command-issuance> 105 + <!-- u-modal在app端弹窗层级无法覆盖背景色 -->
  106 + <mp-command-issuance ref="mpCommandIssuanceRef" :isShowTCP="isShowTCP" :showModal="mpShowModal"
  107 + @hideModal="hideMpModal" @cancelCommand="cancelCommand"
  108 + @confirmCommand="confirmCommand"></mp-command-issuance>
81 <!-- #endif --> 109 <!-- #endif -->
82 </view> 110 </view>
83 </template> 111 </template>
84 112
85 <script> 113 <script>
86 -import { formatToDate } from '@/plugins/utils.js';  
87 -import { issueCommand } from '../api/index.js';  
88 -import api from '@/api/index.js';  
89 -import mpCommandIssuance from './mp-command-issuance.vue';  
90 -import appCommandIssuance from './app-command-issuance.vue'; 114 + import {
  115 + formatToDate
  116 + } from '@/plugins/utils.js';
  117 + import {
  118 + issueCommand
  119 + } from '../api/index.js';
  120 + import api from '@/api/index.js';
  121 + import mpCommandIssuance from './mp-command-issuance.vue';
  122 + import {
  123 + commandTypeList
  124 + } from '../config/data.js'
  125 + import {
  126 + useShowModal
  127 + } from '@/plugins/utils.js'
91 128
92 -export default {  
93 - components: {  
94 - mpCommandIssuance,  
95 - appCommandIssuance  
96 - },  
97 - props: {  
98 - deviceDetail: {  
99 - type: Object,  
100 - default: () => ({})  
101 - }  
102 - },  
103 - data() {  
104 - return {  
105 - mpShowModal: false,  
106 - commandValue: {},  
107 - isShowTCP: false, //用于下发命令时判断是否是TCP/UDP  
108 - modalName: null  
109 - };  
110 - },  
111 - computed: {  
112 - deviceStatus() {  
113 - return this.deviceDetail.deviceState === 'INACTIVE' ? '待激活' : this.deviceDetail.deviceState === 'ONLINE' ? '在线' : '离线';  
114 - },  
115 - deviceType() {  
116 - return this.deviceDetail.deviceType === 'DIRECT_CONNECTION'  
117 - ? '直连设备'  
118 - : this.deviceDetail.deviceType === 'GATEWAY'  
119 - ? '网关设备'  
120 - : this.deviceDetail.deviceType === 'SENSOR'  
121 - ? '网关子设备'  
122 - : '';  
123 - },  
124 - alarmStatus() {  
125 - return this.deviceDetail.alarmStatus === '0' ? '否' : '是'; 129 + export default {
  130 + components: {
  131 + mpCommandIssuance,
126 }, 132 },
127 - formatLastOnlineTime() {  
128 - return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss');  
129 - }  
130 - },  
131 - onLoad() {  
132 - // 隐藏原生的tabbar  
133 - uni.hideTabBar();  
134 - },  
135 - methods: {  
136 - formatTextStatus(deviceState) {  
137 - return deviceState === 'INACTIVE' ? '#666' : deviceState === 'ONLINE' ? '#377DFF' : '#DE4437'; 133 + props: {
  134 + deviceDetail: {
  135 + type: Object,
  136 + default: () => ({})
  137 + }
138 }, 138 },
139 - handleClick() {  
140 - const data = {  
141 - longitude: this.deviceDetail.deviceInfo.longitude || 0,  
142 - latitude: this.deviceDetail.deviceInfo.latitude || 0 139 + data() {
  140 + return {
  141 + current: 0,
  142 + commandTypeList,
  143 + commandTypeStr: 'OneWay',
  144 + inputCommandContent: '',
  145 + mpShowModal: false,
  146 + commandValue: {},
  147 + isShowTCP: false, //用于下发命令时判断是否是TCP/UDP
  148 + modalName: null,
  149 + copyTextValue: {
  150 + "method": "methodThingskit",
  151 + "params": {
  152 + "pin": 7,
  153 + "value": 1
  154 + }
  155 + }
143 }; 156 };
144 - uni.navigateTo({  
145 - url: '/device-subpackage/device-detail/device-position?data=' + JSON.stringify(data)  
146 - });  
147 - },  
148 - disabledScroll() {  
149 - return;  
150 }, 157 },
151 - handleAppShowModal(e) {  
152 - this.modalName = e.currentTarget.dataset.target;  
153 - },  
154 - handleMpShowModal() {  
155 - const { transportType } = this.deviceDetail.deviceProfile;  
156 - this.isShowTCP = transportType == 'TCP' ? true : false;  
157 - this.mpShowModal = true; 158 + computed: {
  159 + deviceStatus() {
  160 + return this.deviceDetail.deviceState === 'INACTIVE' ? '待激活' : this.deviceDetail.deviceState === 'ONLINE' ?
  161 + '在线' : '离线';
  162 + },
  163 + deviceType() {
  164 + return this.deviceDetail.deviceType === 'DIRECT_CONNECTION' ?
  165 + '直连设备' :
  166 + this.deviceDetail.deviceType === 'GATEWAY' ?
  167 + '网关设备' :
  168 + this.deviceDetail.deviceType === 'SENSOR' ?
  169 + '网关子设备' :
  170 + '';
  171 + },
  172 + alarmStatus() {
  173 + return this.deviceDetail.alarmStatus === '0' ? '否' : '是';
  174 + },
  175 + formatLastOnlineTime() {
  176 + return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss');
  177 + }
158 }, 178 },
159 - hideMpModal() {  
160 - this.mpShowModal = false; 179 + beforeCreate() {
  180 + this.modalName = null
161 }, 181 },
162 - hideAppModal() {  
163 - this.modalName = null; 182 + onLoad() {
  183 + // 隐藏原生的tabbar
  184 + uni.hideTabBar();
164 }, 185 },
165 - async confirmCommand(commandType, inputCommandVal) {  
166 - try { 186 + methods: {
  187 + handleCopy(value) {
  188 + useShowModal(JSON.stringify(value), '命令下发', '复制内容').then(res => {
  189 + uni.setClipboardData({
  190 + data: JSON.stringify(value),
  191 + success: () => {
  192 + uni.showToast({
  193 + title: '复制成功'
  194 + })
  195 + }
  196 + });
  197 + })
  198 + },
  199 + radioChange: function(evt) {
  200 + for (let i = 0; i < this.commandTypeList.length; i++) {
  201 + if (this.items[i].value === evt.detail.value) {
  202 + this.current = i;
  203 + break;
  204 + }
  205 + }
  206 + this.commandTypeStr = evt.detail.value
  207 + },
  208 + formatTextStatus(deviceState) {
  209 + return deviceState === 'INACTIVE' ? '#666' : deviceState === 'ONLINE' ? '#377DFF' : '#DE4437';
  210 + },
  211 + handleClick() {
  212 + const data = {
  213 + longitude: this.deviceDetail.deviceInfo.longitude || 0,
  214 + latitude: this.deviceDetail.deviceInfo.latitude || 0
  215 + };
  216 + uni.navigateTo({
  217 + url: '/device-subpackage/device-detail/device-position?data=' + JSON.stringify(data)
  218 + });
  219 + },
  220 + disabledScroll() {
  221 + return;
  222 + },
  223 + handleAppShowModal(e) {
  224 + this.modalName = e.currentTarget.dataset.target;
  225 + },
  226 + handleMpShowModal() {
  227 + const {
  228 + transportType
  229 + } = this.deviceDetail.deviceProfile;
  230 + this.isShowTCP = transportType == 'TCP' ? true : false;
  231 + this.mpShowModal = true;
  232 + },
  233 + hideMpModal() {
  234 + this.mpShowModal = false;
  235 + },
  236 + hideAppModal() {
  237 + this.modalName = null;
  238 + },
  239 + confirmCommand(commandType, inputCommandVal) {
  240 + this.handleCommand(commandType, inputCommandVal)
  241 + },
  242 + cancelCommand() {
  243 + this.hideMpModal();
  244 + this.hideAppModal();
  245 + this.commandTypeStr = 'OneWay'
  246 + this.inputCommandContent = ''
  247 + this.$nextTick(() => {
  248 + this.$refs.mpCommandIssuanceRef.reset()
  249 + })
  250 + },
  251 + handleAppCommand() {
  252 + this.handleCommand(this.commandTypeStr, this.inputCommandContent)
  253 + },
  254 + async handleCommand(commandType, inputCommandVal) {
167 if (this.isShowTCP) { 255 if (this.isShowTCP) {
168 //TCP的格式只能是字符串 256 //TCP的格式只能是字符串
169 const zg = /^[0-9a-zA-Z]*$/; 257 const zg = /^[0-9a-zA-Z]*$/;
@@ -175,92 +263,159 @@ export default { @@ -175,92 +263,159 @@ export default {
175 } else { 263 } else {
176 this.commandValue.params = JSON.parse(inputCommandVal); 264 this.commandValue.params = JSON.parse(inputCommandVal);
177 } 265 }
178 - if (!commandJsonValue) return uni.$u.toast('请输入下发内容~'); 266 + if (!inputCommandVal) return uni.$u.toast('请输入下发内容~');
179 this.commandValue.persistent = true; 267 this.commandValue.persistent = true;
180 this.commandValue.additionalInfo = { 268 this.commandValue.additionalInfo = {
181 cmdType: 'API' 269 cmdType: 'API'
182 }; 270 };
183 this.commandValue.method = 'methodThingskit'; 271 this.commandValue.method = 'methodThingskit';
184 - this.commandValue.params = commandJsonValue; 272 + this.commandValue.params = inputCommandVal;
185 await api.deviceApi.issueCommand(commandType, this.deviceDetail.tbDeviceId, this.commandValue); 273 await api.deviceApi.issueCommand(commandType, this.deviceDetail.tbDeviceId, this.commandValue);
186 this.cancelCommand(); 274 this.cancelCommand();
187 uni.$u.toast('下发成功~'); 275 uni.$u.toast('下发成功~');
188 - } catch (e) {  
189 - uni.$u.toast('下发失败~');  
190 - }  
191 - },  
192 - cancelCommand() {  
193 - this.hideMpModal();  
194 - this.hideAppModal(); 276 +
  277 + },
  278 +
195 } 279 }
196 - }  
197 -}; 280 + };
198 </script> 281 </script>
199 282
200 <style lang="scss" scoped> 283 <style lang="scss" scoped>
201 -@import url('../static/modal.css');  
202 -.basic-page {  
203 - padding: 0 30rpx; 284 + @import url('../static/modal.css');
204 285
205 - .basic-header {  
206 - display: flex;  
207 - justify-content: space-between;  
208 - align-items: center;  
209 - height: 140rpx;  
210 - background-color: #fff;  
211 - border-radius: 20rpx; 286 + .app-command-content {
  287 + .app-command-text {
  288 + display: flex;
  289 + justify-content: center;
  290 + align-items: center;
212 291
213 - .basic-text {  
214 - width: 370rpx; 292 + text {
  293 + font-weight: 700;
  294 + }
215 } 295 }
216 296
217 - .cu-item {  
218 - background: #3388ff;  
219 - border-radius: 12px;  
220 - width: 120rpx;  
221 - height: 48rpx;  
222 - text-align: center;  
223 - line-height: 40rpx; 297 + .app-command-type {
  298 + display: flex;
  299 + margin-top: 20rpx;
  300 + margin-left: 20rpx;
224 301
225 text { 302 text {
226 - font-size: 12px;  
227 - font-family: PingFangSC-Regular, PingFang SC;  
228 - font-weight: 400;  
229 - color: #ffffff; 303 + font-weight: 700;
230 } 304 }
231 } 305 }
232 306
233 - .basic-text-status {  
234 - font-size: 14px; 307 + .app-command-body {
  308 + display: flex;
  309 + align-items: center;
  310 + justify-content: space-between;
  311 + margin-top: 20rpx;
  312 + margin-left: 20rpx;
  313 +
  314 + .app-command-textarea {
  315 + width: 625rpx;
  316 + height: 400rpx;
  317 + background: #FFFFFF;
  318 + box-shadow: 2px 2px 4px 0px rgba(0, 0, 0, 0.03);
  319 + border-radius: 10px;
  320 + }
  321 + }
  322 +
  323 + .app-command-buttons {
  324 + display: flex;
  325 + align-items: center;
  326 + justify-content: space-evenly;
  327 + height: 85rpx;
  328 + margin-top: 20rpx;
  329 + margin-bottom: 20rpx;
  330 +
  331 + .cancel-button {
  332 + width: 300rpx;
  333 + background: #e3e3e5;
  334 + height: 85rpx;
  335 + border-radius: 38rpx;
  336 + line-height: 85rpx;
  337 +
  338 + .cancel-text {
  339 + color: #333333
  340 + }
  341 + }
  342 +
  343 + .confrim-button {
  344 + width: 300rpx;
  345 + background: #3388ff;
  346 + border-radius: 38rpx;
  347 + height: 85rpx;
  348 + line-height: 85rpx;
  349 +
  350 + .confrim-text {
  351 + color: white
  352 + }
  353 + }
235 } 354 }
236 } 355 }
237 356
238 - .detail {  
239 - background-color: #fff;  
240 - margin-top: 30rpx;  
241 - border-radius: 20rpx;  
242 - width: 690rpx; 357 + .basic-page {
  358 + padding: 0 30rpx;
243 359
244 - .detail-item {  
245 - padding: 30rpx; 360 + .basic-header {
246 display: flex; 361 display: flex;
  362 + justify-content: space-between;
247 align-items: center; 363 align-items: center;
  364 + height: 140rpx;
  365 + background-color: #fff;
  366 + border-radius: 20rpx;
248 367
249 - .detail-label {  
250 - color: #333;  
251 - font-size: 15px; 368 + .basic-text {
  369 + width: 370rpx;
252 } 370 }
253 371
254 - .detail-value {  
255 - color: #666; 372 + .cu-item {
  373 + background: #3388ff;
  374 + border-radius: 12px;
  375 + width: 120rpx;
  376 + height: 48rpx;
  377 + text-align: center;
  378 + line-height: 40rpx;
  379 +
  380 + text {
  381 + font-size: 12px;
  382 + font-family: PingFangSC-Regular, PingFang SC;
  383 + font-weight: 400;
  384 + color: #ffffff;
  385 + }
  386 + }
  387 +
  388 + .basic-text-status {
256 font-size: 14px; 389 font-size: 14px;
257 - margin-left: 30rpx; 390 + }
  391 + }
  392 +
  393 + .detail {
  394 + background-color: #fff;
  395 + margin-top: 30rpx;
  396 + border-radius: 20rpx;
  397 + width: 690rpx;
  398 +
  399 + .detail-item {
  400 + padding: 30rpx;
  401 + display: flex;
  402 + align-items: center;
  403 +
  404 + .detail-label {
  405 + color: #333;
  406 + font-size: 15px;
  407 + }
  408 +
  409 + .detail-value {
  410 + color: #666;
  411 + font-size: 14px;
  412 + margin-left: 30rpx;
  413 + }
258 } 414 }
259 } 415 }
260 } 416 }
261 -}  
262 417
263 -/deep/ .u-modal__content {  
264 - padding: 30rpx 0 !important;  
265 -}  
266 -</style> 418 + /deep/ .u-modal__content {
  419 + padding: 30rpx 0 !important;
  420 + }
  421 +</style>
@@ -78,6 +78,10 @@ @@ -78,6 +78,10 @@
78 } 78 }
79 }); 79 });
80 }) 80 })
  81 + },
  82 + reset() {
  83 + this.commandType = 'OneWay'
  84 + this.inputCommandVal = ''
81 } 85 }
82 } 86 }
83 } 87 }
@@ -59,7 +59,19 @@ const issueStatus = [{ @@ -59,7 +59,19 @@ const issueStatus = [{
59 } 59 }
60 ] 60 ]
61 61
  62 +const commandTypeList = [{
  63 + value: 'OneWay',
  64 + name: '单向',
  65 + },
  66 + {
  67 + value: 'TwoWay',
  68 + name: '双向'
  69 + },
  70 +]
  71 +
  72 +
62 export { 73 export {
63 list, 74 list,
64 - issueStatus 75 + issueStatus,
  76 + commandTypeList
65 } 77 }
@@ -82,6 +82,7 @@ @@ -82,6 +82,7 @@
82 } from 'vuex'; 82 } from 'vuex';
83 import { 83 import {
84 useNavigateTo, 84 useNavigateTo,
  85 + useReLaunch,
85 useShowModal 86 useShowModal
86 } from '@/plugins/utils.js' 87 } from '@/plugins/utils.js'
87 88
@@ -164,7 +165,8 @@ @@ -164,7 +165,8 @@
164 if (res.confirm) { 165 if (res.confirm) {
165 that.emptyUserInfo(); 166 that.emptyUserInfo();
166 that.showLogout = false; 167 that.showLogout = false;
167 - useNavigateTo('/login-subpackage/public/login') 168 + //不能使用navigatorTo,会显示返回按钮
  169 + useReLaunch('/login-subpackage/public/login')
168 } 170 }
169 }) 171 })
170 }, 172 },
@@ -51,6 +51,14 @@ button { @@ -51,6 +51,14 @@ button {
51 display: flex; 51 display: flex;
52 flex-direction: column; 52 flex-direction: column;
53 } 53 }
  54 +.flex{
  55 + display: flex;
  56 +}
  57 +.justify-center{
  58 + display: flex;
  59 + justify-content: center;
  60 + align-items: center;
  61 +}
54 .mt-3{ 62 .mt-3{
55 margin-top: 30rpx; 63 margin-top: 30rpx;
56 } 64 }
@@ -60,6 +68,9 @@ button { @@ -60,6 +68,9 @@ button {
60 .mt-15{ 68 .mt-15{
61 margin-top: 15rpx; 69 margin-top: 15rpx;
62 } 70 }
  71 +.mr-1{
  72 + margin-right: 10rpx;
  73 +}
63 .mr-2{ 74 .mr-2{
64 margin-right: 20rpx; 75 margin-right: 20rpx;
65 } 76 }