sh-tools 2.1.0 → 2.1.2

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.0",
3
+ "version": "2.1.2",
4
4
  "description": "基于xe-ajax和xe-utils二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -199,7 +199,6 @@ export default {
199
199
  case '$vTime':
200
200
  format = format ? format.replace('YYYY', 'yyyy').replace('DD', 'dd').replace('hh', 'HH') : defaultDateFormat[type]
201
201
  if (!$vUtils.isNone(value) && format) rvalue = $vUtils.toDateString(value, format)
202
- if ($vUtils.isDate(value)) $vUtils.set(rowData, key, rvalue)
203
202
  break
204
203
  case '$vSelect':
205
204
  case '$vCheckgroup':
@@ -223,12 +222,16 @@ export default {
223
222
  .filter(_ => _ && _ !== 'undefined')
224
223
  }
225
224
  if (options && options.length) {
226
- let rns = oriArray.map(orv => options.find(option => $vUtils.isEqual(option[optionValue], orv))[optionLabel] || '')
225
+ let rns = oriArray.map(orv => {
226
+ let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], orv))
227
+ return valueOption ? valueOption[optionLabel] : ''
228
+ })
227
229
  rtext = rns.join(split)
228
230
  }
229
231
  rvalue = oriArray
230
232
  } else {
231
- rtext = options.find(opt => $vUtils.isEqual(opt[optionValue], value))[optionLabel] || ''
233
+ let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], orv))
234
+ rtext = valueOption ? valueOption[optionLabel] : ''
232
235
  rvalue = type === '$vTree' ? (value ? [value] : []) : value
233
236
  }
234
237
  if (format) {