|
@@ -16,8 +16,15 @@
|
16
|
16
|
<button v-if="dataInfo.type" @click="replace" type="default" class="primaryButton btn">选择巡检点</button>
|
17
|
17
|
<button v-if="dataInfo.newPollingData" @click="save" type="default" class="primaryButton btn">保存</button>
|
18
|
18
|
</view>
|
19
|
|
- <uni-popup ref="alertDialog" type="dialog">
|
20
|
|
- <uni-popup-dialog type="info" :before-close="true" cancelText="取消" confirmText="确认" title="提示" :content="dataInfo.content" @confirm="dialogConfirm" @close="close"></uni-popup-dialog>
|
|
19
|
+ <uni-popup ref="alertDialog" type="dialog" :mask-click="false">
|
|
20
|
+ <view class="popup-content">
|
|
21
|
+ <view class="tip">提示</view>
|
|
22
|
+ <view class="content">{{dataInfo.content}}</view>
|
|
23
|
+ </view>
|
|
24
|
+ <view class="btn-box">
|
|
25
|
+ <view @click="close" class="btn-item-50 color-close">取消</view>
|
|
26
|
+ <view @click="dialogConfirm" class="btn-item-50 color">确认</view>
|
|
27
|
+ </view>
|
21
|
28
|
</uni-popup>
|
22
|
29
|
</view>
|
23
|
30
|
</template>
|
|
@@ -25,14 +32,14 @@
|
25
|
32
|
<script setup>
|
26
|
33
|
import { SM } from "@/http/http.js"
|
27
|
34
|
import { ref, reactive, computed } from 'vue'
|
28
|
|
- import { onLoad } from '@dcloudio/uni-app'
|
|
35
|
+ import { onLoad, onUnload } from '@dcloudio/uni-app'
|
29
|
36
|
import { api_inspectionNode, api_inspectionNodeEdit } from "@/http/api.js"
|
30
|
37
|
import { defaultColor } from '@/static/js/theme.js'
|
31
|
38
|
import { useSetTitle } from '@/share/useSetTitle.js'
|
32
|
39
|
import { useGoBack } from '@/share/useGoBack.js'
|
33
|
40
|
import { useLoginUserStore } from '@/stores/loginUser'
|
34
|
41
|
import { post } from "@/http/http.js"
|
35
|
|
-import { join } from "lodash-es"
|
|
42
|
+ import { join } from "lodash-es"
|
36
|
43
|
useSetTitle();
|
37
|
44
|
const loginUserStore = useLoginUserStore();
|
38
|
45
|
const { goBack } = useGoBack();
|
|
@@ -48,9 +55,21 @@ import { join } from "lodash-es"
|
48
|
55
|
pollingId:null,
|
49
|
56
|
newPollingData:null,
|
50
|
57
|
content:'',
|
51
|
|
- type:false
|
|
58
|
+ type:false,
|
|
59
|
+ bindingPolling:false
|
52
|
60
|
})
|
53
|
61
|
|
|
62
|
+ // 清空数据
|
|
63
|
+ function setInfoData(){
|
|
64
|
+ dataInfo.pollingData = '无'
|
|
65
|
+ dataInfo.pollingId = null
|
|
66
|
+ dataInfo.newPollingData = null
|
|
67
|
+ dataInfo.content = ''
|
|
68
|
+ dataInfo.type = false
|
|
69
|
+ dataInfo.bindingPolling = false
|
|
70
|
+ uni.removeStorageSync('pollingCode')
|
|
71
|
+ }
|
|
72
|
+
|
54
|
73
|
// 选择巡检点
|
55
|
74
|
function replace(){
|
56
|
75
|
// let data = {
|
|
@@ -82,20 +101,20 @@ import { join } from "lodash-es"
|
82
|
101
|
code: data.code
|
83
|
102
|
}
|
84
|
103
|
}
|
|
104
|
+ uni.showLoading({
|
|
105
|
+ title: "加载中",
|
|
106
|
+ mask: true,
|
|
107
|
+ });
|
85
|
108
|
api_inspectionNodeEdit(query).then((result) => {
|
86
|
109
|
if (result.status == 200) {
|
|
110
|
+ uni.hideLoading();
|
87
|
111
|
uni.showToast({
|
88
|
112
|
icon: 'none',
|
89
|
113
|
title: result.msg
|
90
|
114
|
});
|
|
115
|
+ alertDialog.value.close()
|
91
|
116
|
setTimeout(_=>{
|
92
|
|
- alertDialog.value.close()
|
93
|
|
- dataInfo.pollingData = '无'
|
94
|
|
- dataInfo.pollingId = null
|
95
|
|
- dataInfo.newPollingData = null
|
96
|
|
- dataInfo.content = ''
|
97
|
|
- dataInfo.type = false
|
98
|
|
- uni.removeStorageSync('pollingCode')
|
|
117
|
+ setInfoData()
|
99
|
118
|
},1000)
|
100
|
119
|
} else {
|
101
|
120
|
uni.showToast({
|
|
@@ -163,9 +182,18 @@ import { join } from "lodash-es"
|
163
|
182
|
dataInfo.content = `二维码绑定为“${dataInfo.newPollingData.name}”,原“${dataInfo.pollingData}”二维码被清空,您确认绑定吗?`
|
164
|
183
|
}
|
165
|
184
|
})
|
|
185
|
+
|
|
186
|
+ onUnload(()=>{
|
|
187
|
+ setInfoData()
|
|
188
|
+ })
|
166
|
189
|
</script>
|
167
|
190
|
|
168
|
191
|
<style>
|
|
192
|
+ >>> .uni-popup .uni-popup__wrapper{
|
|
193
|
+ background-color: #fff !important;
|
|
194
|
+ width: 90%;
|
|
195
|
+ border-radius: 10rpx;
|
|
196
|
+ }
|
169
|
197
|
>>> .uni-popup__info{
|
170
|
198
|
color: #333 !important;
|
171
|
199
|
}
|
|
@@ -208,5 +236,35 @@ import { join } from "lodash-es"
|
208
|
236
|
}
|
209
|
237
|
}
|
210
|
238
|
}
|
|
239
|
+ .popup-content{
|
|
240
|
+ padding: 20rpx;
|
|
241
|
+ text-align: center;
|
|
242
|
+ .tip{
|
|
243
|
+ font-size: 32rpx;
|
|
244
|
+ color: #333;
|
|
245
|
+ margin-bottom: 20rpx;
|
|
246
|
+ }
|
|
247
|
+ .content{
|
|
248
|
+ color: #6C6C6C;
|
|
249
|
+ padding: 20rpx;
|
|
250
|
+ }
|
|
251
|
+ }
|
|
252
|
+ .btn-box{
|
|
253
|
+ display: flex;
|
|
254
|
+ border-top: 1px solid #E3E3E3;
|
|
255
|
+ .btn-item-50{
|
|
256
|
+ flex: 1;
|
|
257
|
+ height: 90rpx;
|
|
258
|
+ line-height: 90rpx;
|
|
259
|
+ text-align: center;
|
|
260
|
+ }
|
|
261
|
+ .color-close{
|
|
262
|
+ color: #606266;
|
|
263
|
+ }
|
|
264
|
+ .color{
|
|
265
|
+ color: #49B856;
|
|
266
|
+ border-left: 1px solid #E3E3E3;
|
|
267
|
+ }
|
|
268
|
+ }
|
211
|
269
|
}
|
212
|
270
|
</style>
|