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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-tools",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "基于xe-ajax和xe-utils二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -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(type)
209
+ let isMutiple = multiple || ['$vCheckgroup', '$vUpload'].includes(rname)
210
210
  let optionValue = 'value'
211
211
  let optionLabel = 'label'
212
- if (type === '$vTree') {
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], orv))
233
+ let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], value))
234
234
  rtext = valueOption ? valueOption[optionLabel] : ''
235
- rvalue = type === '$vTree' ? (value ? [value] : []) : value
235
+ rvalue = rname === '$vTree' ? (value ? [value] : []) : value
236
236
  }
237
237
  if (format) {
238
238
  let dataformat = format.replace(/@/gi, prefixKey)