@netang/quasar 0.2.48 → 0.2.49
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 +1 -1
- package/utils/$table.js +11 -1
- package/utils/useSearch.js +1 -1
package/package.json
CHANGED
package/utils/$table.js
CHANGED
|
@@ -10,6 +10,7 @@ import $n_findIndex from 'lodash/findIndex'
|
|
|
10
10
|
import $n_uniq from 'lodash/uniq'
|
|
11
11
|
import $n_concat from 'lodash/concat'
|
|
12
12
|
import $n_isNil from 'lodash/isNil'
|
|
13
|
+
import $n_isArray from 'lodash/isArray'
|
|
13
14
|
|
|
14
15
|
import $n_router from '@netang/utils/vue/router'
|
|
15
16
|
|
|
@@ -336,7 +337,16 @@ function create(options) {
|
|
|
336
337
|
// 如果有数据字典
|
|
337
338
|
} else if ($n_has(item, 'dict')) {
|
|
338
339
|
if (! $n_has(item, 'format')) {
|
|
339
|
-
item.format =
|
|
340
|
+
item.format = $n_isArray(item.dict)
|
|
341
|
+
? function (val) {
|
|
342
|
+
for (const e of item.dict) {
|
|
343
|
+
if (e.value === val) {
|
|
344
|
+
return e.label
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return ''
|
|
348
|
+
}
|
|
349
|
+
: val => $n_dict(item.dict, val)
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
// 如果有图片
|
package/utils/useSearch.js
CHANGED
|
@@ -381,7 +381,7 @@ export async function getOptions(rawSearchOptions, format) {
|
|
|
381
381
|
$n_merge(newItem, {
|
|
382
382
|
searchType: 'select',
|
|
383
383
|
select: {
|
|
384
|
-
options: $n_dictOptions(newItem.dict)
|
|
384
|
+
options: $n_isArray(newItem.dict) ? newItem.dict : $n_dictOptions(newItem.dict),
|
|
385
385
|
},
|
|
386
386
|
})
|
|
387
387
|
|