n20-common-lib 1.3.53 → 1.3.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.3.53",
3
+ "version": "1.3.56",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -29,6 +29,11 @@
29
29
  >驳回</span
30
30
  ></template
31
31
  >
32
+ <template v-else-if="item.result == status.invalid">
33
+ 审批意见:<span class="n20-approval-reject"
34
+ >作废</span
35
+ ></template
36
+ >
32
37
  </div>
33
38
  </div>
34
39
  <div v-if="item.suggestion" class="n20-description-c">
@@ -81,7 +86,8 @@ export default {
81
86
  submit: 1,
82
87
  approval: 2,
83
88
  reject: 3,
84
- end: 4
89
+ invalid: 4,
90
+ end: 5
85
91
  })
86
92
  },
87
93
  approvalData: {
@@ -107,21 +113,21 @@ export default {
107
113
  assignee: item.assignee,
108
114
  suggestion: item.suggestion
109
115
  }
110
- if ('approvalState' in item) {
116
+
117
+ if (item.taskName === '开始') {
118
+ _item.result = 1
119
+ } else if (item.taskName === '结束') {
120
+ _item.result = 5
121
+ } else if ('approvalState' in item) {
111
122
  _item.result = item.approvalState
123
+ } else if (!item.endTime) {
124
+ _item.result = 0
125
+ } else if (item.rejectFlag === 1) {
126
+ _item.result = 3
112
127
  } else {
113
- if (item.taskName === '开始') {
114
- _item.result = 1
115
- } else if (item.taskName === '结束') {
116
- _item.result = 4
117
- } else if (!item.endTime) {
118
- _item.result = 0
119
- } else if (item.rejectFlag === 1) {
120
- _item.result = 3
121
- } else {
122
- _item.result = 2
123
- }
128
+ _item.result = 2
124
129
  }
130
+
125
131
  approvalData.push(_item)
126
132
  })
127
133
  this.approvalData.push(...approvalData)
@@ -2,14 +2,20 @@
2
2
  <template>
3
3
  <div class="approve-img">
4
4
  <img v-if="blobUrl" :src="blobUrl" />
5
+ <flowImg v-else-if="dataPro" :data-pro="dataPro" />
5
6
  </div>
6
7
  </template>
7
8
 
8
9
  <script>
9
10
  import axios from '../../utils/axios'
11
+ import flowImg from './approvalImgPro/index.vue'
12
+ let hasQ004_1 = true
10
13
 
11
14
  export default {
12
15
  name: 'ApprovalImg',
16
+ components: {
17
+ flowImg
18
+ },
13
19
  props: {
14
20
  procInstId: {
15
21
  type: String,
@@ -18,22 +24,54 @@ export default {
18
24
  },
19
25
  data() {
20
26
  return {
21
- blobUrl: undefined
27
+ blobUrl: undefined,
28
+ dataPro: undefined
22
29
  }
23
30
  },
24
- created() {
25
- axios
26
- .get('/bems/activiti/sample/Q004', {
27
- procInstId: this.procInstId || this.$route.query.procInstId
28
- })
29
- .then(({ data }) => {
30
- if (data) {
31
- let file = new File([data], '流程图.svg', {
32
- type: 'image/svg+xml'
33
- })
34
- this.blobUrl = URL.createObjectURL(file)
35
- }
36
- })
31
+ async created() {
32
+ hasQ004_1 ? this.getFlowData() : this.getSvg()
33
+ },
34
+ methods: {
35
+ getSvg() {
36
+ axios
37
+ .get('/bems/activiti/sample/Q004', {
38
+ procInstId: this.procInstId || this.$route.query.processInstanceId
39
+ })
40
+ .then(({ data }) => {
41
+ if (data) {
42
+ let file = new File([data], '流程图.svg', {
43
+ type: 'image/svg+xml'
44
+ })
45
+ this.blobUrl = URL.createObjectURL(file)
46
+ }
47
+ })
48
+ },
49
+ getFlowData() {
50
+ axios
51
+ .get(
52
+ '/bems/activiti/sample/Q004_1',
53
+ {
54
+ procInstId: this.procInstId || this.$route.query.processInstanceId
55
+ },
56
+ { noMsg: true }
57
+ )
58
+ .then((res) => {
59
+ this.dataPro = res.data
60
+ })
61
+ .catch((err) => {
62
+ if (err.msg && err.msg.includes('404')) {
63
+ hasQ004_1 = false
64
+ this.getSvg()
65
+ } else {
66
+ this.$message({
67
+ showClose: true,
68
+ message: err.msg,
69
+ type: 'error',
70
+ customClass: 'xhr-msg-top'
71
+ })
72
+ }
73
+ })
74
+ }
37
75
  }
38
76
  }
39
77
  </script>