n20-common-lib 2.5.39 → 2.5.40

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": "2.5.39",
3
+ "version": "2.5.40",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -53,14 +53,31 @@ export default {
53
53
  getData() {
54
54
  if (this.andUser) {
55
55
  axios.post('/bems/activiti/actAppOpi/queryAppOpiAndUser', null, { loading: false }).then(({ data }) => {
56
- this.approveMsgList = data || []
56
+ this.approveMsgList = this.getOnlyData(data || [])
57
57
  })
58
58
  } else {
59
59
  axios.post('/bems/activiti/actAppOpi/queryAppOpi', null, { loading: false }).then(({ data }) => {
60
- this.approveMsgList = data.list || []
60
+ this.approveMsgList = this.getOnlyData(data.list || [])
61
61
  })
62
62
  }
63
63
  },
64
+ getOnlyData(data) {
65
+ const length = data.length
66
+ if (length === 0) {
67
+ return result
68
+ }
69
+ let result = []
70
+ const suggestionMap = {}
71
+ for (let i = 0; i < length; i++) {
72
+ let currentItem = data[i]
73
+ let suggestion = currentItem.suggestion
74
+ if (!suggestionMap[suggestion]) {
75
+ suggestionMap[suggestion] = true
76
+ result.push(currentItem)
77
+ }
78
+ }
79
+ return result
80
+ },
64
81
  changeFn() {
65
82
  // if (this.approveMsgSlt?.length) {
66
83
  this.$emit(