sh-tools 2.1.2 → 2.1.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 +1 -1
- package/packages/utils/other.js +5 -5
package/package.json
CHANGED
package/packages/utils/other.js
CHANGED
|
@@ -206,11 +206,11 @@ export default {
|
|
|
206
206
|
case '$vUpload':
|
|
207
207
|
case '$vTree':
|
|
208
208
|
let prefixKey = key.endsWith('Id') ? String(key).replace('Id', '') : key
|
|
209
|
-
let isMutiple = multiple || ['$vCheckgroup', '$vUpload'].includes(
|
|
209
|
+
let isMutiple = multiple || ['$vCheckgroup', '$vUpload'].includes(rname)
|
|
210
210
|
let optionValue = 'value'
|
|
211
211
|
let optionLabel = 'label'
|
|
212
|
-
if (
|
|
213
|
-
optionValue = nodeKey
|
|
212
|
+
if (rname === '$vTree') {
|
|
213
|
+
optionValue = nodeKey || 'id'
|
|
214
214
|
if (labelField) optionLabel = labelField
|
|
215
215
|
}
|
|
216
216
|
if (isMutiple) {
|
|
@@ -230,9 +230,9 @@ export default {
|
|
|
230
230
|
}
|
|
231
231
|
rvalue = oriArray
|
|
232
232
|
} else {
|
|
233
|
-
let valueOption = options.find(option => $vUtils.isEqual(option[optionValue],
|
|
233
|
+
let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], value))
|
|
234
234
|
rtext = valueOption ? valueOption[optionLabel] : ''
|
|
235
|
-
rvalue =
|
|
235
|
+
rvalue = rname === '$vTree' ? (value ? [value] : []) : value
|
|
236
236
|
}
|
|
237
237
|
if (format) {
|
|
238
238
|
let dataformat = format.replace(/@/gi, prefixKey)
|