ny
22 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
<script lang="ts" setup>
import { nextTick, onMounted, reactive } from 'vue';
import { useRoute } from 'vue-router';
 
import { useAccessStore } from '@vben/stores';
 
import { getFlowTaskInfo } from '#/api/workFlow/task';
import FlowProcessMain from '#/components/FlowProcess/src/Main.vue';
 
interface State {
  nodeList: any;
  flowInfo: any;
  loading: boolean;
  key: number;
}
 
const state = reactive<State>({
  nodeList: {},
  flowInfo: {},
  loading: false,
  key: Date.now(),
});
const route = useRoute();
const accessStore = useAccessStore();
 
function init() {
  const query = route.query;
  if (!query.token) return;
  state.loading = true;
  accessStore.setAccessToken(query.token as string);
  nextTick(() => {
    getBeforeInfo(query);
  });
}
function getBeforeInfo(query) {
  getFlowTaskInfo(query.id || '0', { operatorId: query.operatorId, flowId: query.flowId, opTypw: query.opTypw })
    .then((res) => {
      state.flowInfo = res.data.flowInfo || {};
      state.nodeList = res.data.nodeList || [];
      state.loading = false;
      state.key = Date.now();
    })
    .catch(() => {
      state.loading = false;
    });
}
 
onMounted(() => {
  init();
});
</script>
<template>
  <FlowProcessMain
    class="pt-[10px]"
    :flow-info="state.flowInfo"
    :node-list="state.nodeList"
    :is-preview="true"
    :no-show-scale="true"
    v-if="state.flowInfo.id"
    :key="state.key" />
</template>