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
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.8.103-1.8.104 -2024-3-14 @张振宇**
4
+ **1.8.103-1.8.106 -2024-3-14 @张振宇**
5
5
  - 增加对话库功能
6
6
  - 修复xbadge不更新展示问题
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.104",
3
+ "version": "1.8.106",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <div v-if="dictionary && dictionary.status !== 'none'">
3
3
  <!-- 徽标存在时 -->
4
- <a-badge v-if="dictionary.status !== 'gary'" :color="dictionary.status" :text="!isExternalText ? dictionary.text: null"/>
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, res => {
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
- getConfigByName(dictKey, undefined, result => {
58
- for (const item of result.value) {
59
- if (item.value == value) {
60
- func({
61
- status: item.status || 'none',
62
- text: item.label
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
- func({
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 '@/services/api'
185
+ import { post } from '@vue2-client/services/api'
186
186
 
187
187
  export default {
188
188
  props: {
package/vue.config.js CHANGED
@@ -73,7 +73,6 @@ module.exports = {
73
73
  config.resolve = {
74
74
  extensions: ['.js', '.vue', '.json'],
75
75
  alias: {
76
- '@': path.resolve('src'),
77
76
  '@vue2-client': path.resolve('src')
78
77
  }
79
78
  }