zxl
4 天以前 874e9cce3b2f9b6649ab72047d98e4244a345b3c
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
<template>
  <view class="content"> 
 
    <BottomTabBar active="progress" />
     <web-view :src="url"></web-view>
  </view>
</template>
 
<script>
import BottomTabBar from '@/components/BottomTabBar.vue'
import LogTimeLine from '@/components/log-time-line.vue'
 
export default {
  name: 'TaskProcess',
  components: { BottomTabBar, LogTimeLine },
  data() {
    return {
      url:'',
    }
  },
  onLoad(query) {
    // 封装解码工具函数
    const decodeValue = (value) => {
      if (typeof value !== 'string' || value === '') return '';
      try {
        return decodeURIComponent(value);
      } catch (e) {
        console.error('参数解码失败:', e, '原始值:', value);
        return value;
      }
    };
    // 需要拼接必要的参数 来通过验证 
    let token = uni.getStorageSync('token') || '';
    const isView = query.isView === 'true' || query.isView === true;
    const pageName = isView ? 'web-view-entry' : 'web-view-send';
    this.url = `http://192.168.0.2/${pageName}?token=${token}`;
 
 
    let deployId = 'deployId=' + decodeValue(query.deployId)
 
    let taskId = 'taskId=' + decodeValue(query.taskId)
 
    let procInsId = 'procInsId=' + decodeValue(query.procInsId)
    
    let projectName = 'projectName=' + decodeValue(query.projectName)
 
    let flowName = 'flowName=' + decodeValue(query.flowName)
   
    let processName = 'processName=' + decodeValue(query.processName)
 
    console.log(deployId, taskId, procInsId, projectName, flowName, processName)
    this.url += '&'+ deployId + '&' + taskId + '&' + procInsId + '&' + projectName + '&' + flowName + '&' + processName;
    console.log(this.url)
  },
  methods: {
 
    /**
     * 返回上一页
     */
    handleBack() {
      uni.navigateBack();
    }
  }
}
</script>
 
<style scoped>
.content {
  width: 100%;
  min-height: 100vh;
  background-color: #f5f7fa;
  padding-bottom: 120rpx;
}
 
 
</style>