vue2-client 1.19.3 → 1.19.4

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": "vue2-client",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -136,7 +136,21 @@ export default {
136
136
  console.warn(`Config '${configName}' did not return a valid 'value' array for options. Result:`, res)
137
137
  }
138
138
  } else {
139
- // 移除对旧字典的解析
139
+ // 全局字典
140
+ if (this.$appdata && typeof this.$appdata.getDictByKeyAsync === 'function') {
141
+ const dictionaryList = await this.$appdata.getDictByKeyAsync(item.keyName)
142
+ if (Array.isArray(dictionaryList)) {
143
+ fetchedOptions = dictionaryList.map(opt => ({
144
+ label: opt.label,
145
+ value: opt.value + '',
146
+ ...opt // 将所有原始属性也添加到选项中
147
+ }))
148
+ } else {
149
+ console.warn(`Global dictionary '${item.keyName}' did not return an array. Result:`, dictionaryList)
150
+ }
151
+ } else {
152
+ console.error('$appdata.getDictionaryList is not available. Please ensure it\'s globally provided.')
153
+ }
140
154
  }
141
155
  } catch (error) {
142
156
  console.error(`Error fetching options for item '${item.key}':`, error)
@@ -144,6 +144,22 @@
144
144
  </template>
145
145
  </a-select-option>
146
146
  </template>
147
+ <template v-else>
148
+ <a-select-option
149
+ v-for="item in $appdata.getDictByKeyAsync(attr.keyName)"
150
+ :key="item.value"
151
+ :value="item.value + ''"
152
+ >
153
+ <!-- 徽标(badge) -->
154
+ <x-badge
155
+ :badge-key="attr.keyName"
156
+ :replaceText="item.label"
157
+ :value="item.value"
158
+ :service-name="serviceName"
159
+ :env="env"
160
+ />
161
+ </a-select-option>
162
+ </template>
147
163
  </template>
148
164
  </a-select>
149
165
  <a-select
@@ -243,6 +259,15 @@
243
259
  </template>
244
260
  </a-select-option>
245
261
  </template>
262
+ <template v-else>
263
+ <a-select-option
264
+ v-for="item in $appdata.getDictByKeyAsync(attr.keyName)"
265
+ :key="item.value"
266
+ :value="item.value + ''"
267
+ >
268
+ {{ item.label }}
269
+ </a-select-option>
270
+ </template>
246
271
  </template>
247
272
  </a-select>
248
273
  <a-select
@@ -308,6 +333,11 @@
308
333
  {{ item.label }}
309
334
  </a-radio>
310
335
  </template>
336
+ <template v-else>
337
+ <a-radio v-for="(item, index) in $appdata.getDictByKeyAsync(attr.keyName)" :key="index" :value="item.value">
338
+ {{ item.label }}
339
+ </a-radio>
340
+ </template>
311
341
  </template>
312
342
  </a-radio-group>
313
343
  </a-form-model-item>
@@ -1125,7 +1125,7 @@ export default {
1125
1125
  if (stepDefine.formType === 'select') {
1126
1126
  let dictList
1127
1127
  if (stepDefine.selectType === 'key') {
1128
- dictList = []
1128
+ dictList = await this.$appdata.getDictByKeyAsync(stepDefine.selectKey)
1129
1129
  } else if (stepDefine.selectType === 'config') {
1130
1130
  const configName = stepDefine.selectKey.substring(7)
1131
1131
  dictList = await this.$appdata.getDictByKeyAsync(configName)
@@ -787,7 +787,7 @@ export default {
787
787
  if (stepDefine.formType === 'select') {
788
788
  let dictList
789
789
  if (stepDefine.selectType === 'key') {
790
- dictList = []
790
+ dictList = await this.$appdata.getDictByKeyAsync(stepDefine.selectKey)
791
791
  } else if (stepDefine.selectType === 'config') {
792
792
  const configName = stepDefine.selectKey.substring(7)
793
793
  dictList = await this.$appdata.getDictByKeyAsync(configName)