p-honggang.li
5 天以前 80ca024e9ae633df0dc9f4e8f533f33b526afb3d
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
<template>
  <div class="track-page">
    <el-card shadow="never">
 
      <div class="content">
        <div class="iframe-wrap" v-if="iframeUrl">
          <iframe :src="iframeUrl" class="workflow-iframe" referrerpolicy="no-referrer"></iframe>
        </div>
        <div v-else class="empty">暂无流程实例ID</div>
      </div>
    </el-card>
    <div class="action-buttons">
      <el-button @click="goBack">返回</el-button>
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
 
const route = useRoute()
const router = useRouter()
 
const processId = computed(() => {
  return route.query.processinstId || route.params.id || ''
})
 
const hostUrl =  import.meta.env.VITE_AXIOS_BASE_URL
 
const iframeUrl = computed(() => {
  const pid = processId.value
  if (pid && pid.toString().trim()) {
    return `${hostUrl}/activity/history?processinstId=${encodeURIComponent(pid.toString().trim())}`
  }
  return ''
})
 
const goBack = () => router.back()
</script>
 
<style scoped>
.track-page {
  padding: 20px;
}
.title {
  font-weight: 600;
  margin-bottom: 10px;
}
.content {
  margin-top: 10px;
}
.iframe-wrap {
  margin-top: 10px;
}
.workflow-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 6px;
}
.action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}
.empty {
  text-align: center;
  color: #909399;
  padding: 40px 0;
}
</style>