vue2-client 1.8.104 → 1.8.106
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="dictionary && dictionary.status !== 'none'">
|
|
3
3
|
<!-- 徽标存在时 -->
|
|
4
|
-
<a-badge
|
|
4
|
+
<a-badge
|
|
5
|
+
v-if="dictionary.status !== 'gary'"
|
|
6
|
+
:color="dictionary.status"
|
|
7
|
+
:text="!isExternalText ? dictionary.text: null"/>
|
|
5
8
|
<a-badge v-else color="#D9D9D9" :text="!isExternalText ? dictionary.text: null"/>
|
|
6
9
|
<span v-if="isExternalText">{{ dictionary.text }}</span>
|
|
7
10
|
</div>
|
|
@@ -56,15 +59,13 @@ export default {
|
|
|
56
59
|
},
|
|
57
60
|
methods: {
|
|
58
61
|
// todo 修改方式 想办法不使用回调方式
|
|
59
|
-
updateDictionary () {
|
|
62
|
+
async updateDictionary () {
|
|
60
63
|
const result = this.$appdata.getParam(this.badgeKey, this.value)
|
|
61
64
|
if (result) {
|
|
62
65
|
this.dictionary = result
|
|
63
66
|
return
|
|
64
67
|
}
|
|
65
|
-
this.$appdata.getDictValue(this.badgeKey, this.value, undefined
|
|
66
|
-
this.dictionary = res
|
|
67
|
-
})
|
|
68
|
+
this.dictionary = await this.$appdata.getDictValue(this.badgeKey, this.value, undefined)
|
|
68
69
|
},
|
|
69
70
|
badgeFilter (key, value) {
|
|
70
71
|
return this.$appdata.getParam(key, value)
|
|
@@ -53,21 +53,30 @@ const GetAppDataService = {
|
|
|
53
53
|
const object = JSON.parse(str)
|
|
54
54
|
return object[key]
|
|
55
55
|
},
|
|
56
|
-
getDictValue (dictKey, value, func) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
56
|
+
async getDictValue (dictKey, value, func) {
|
|
57
|
+
const processResult = (result) => {
|
|
58
|
+
const item = result.value.find(item => item.value == value)
|
|
59
|
+
if (item) {
|
|
60
|
+
return {
|
|
61
|
+
status: item.status || 'none',
|
|
62
|
+
text: item.label
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
|
|
65
|
+
return {
|
|
67
66
|
status: 'none',
|
|
68
67
|
text: value
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (func) {
|
|
71
|
+
getConfigByName(dictKey, undefined, result => {
|
|
72
|
+
func(processResult(result))
|
|
69
73
|
})
|
|
70
|
-
}
|
|
74
|
+
} else {
|
|
75
|
+
const result = await new Promise((resolve) => {
|
|
76
|
+
getConfigByName(dictKey, undefined, resolve)
|
|
77
|
+
})
|
|
78
|
+
return processResult(result)
|
|
79
|
+
}
|
|
71
80
|
},
|
|
72
81
|
getParam (key, value, callback) {
|
|
73
82
|
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
<script>
|
|
183
183
|
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
184
184
|
import { formatDate } from '@vue2-client/utils/util'
|
|
185
|
-
import { post } from '
|
|
185
|
+
import { post } from '@vue2-client/services/api'
|
|
186
186
|
|
|
187
187
|
export default {
|
|
188
188
|
props: {
|