lincl 1 rok temu
rodzic
commit
3f0701ce25
1 zmienionych plików z 20 dodań i 17 usunięć
  1. 20 17
      src/components/Form/form.vue

+ 20 - 17
src/components/Form/form.vue

@ -143,25 +143,28 @@ export default {
			})
		},
		onSelChange(value, item){
			if(item.onChange){
				if(item.multiple){
					if(item.valueName.length < value.length){
						var exist = _.find(item.optionList, (v)=>{
							return v.value == value[value.length - 1]
						})
						item.valueName.push(exist.label)
			if(item.multiple){
				if(item.valueName.length < value.length){
					var exist = _.find(item.optionList, (v)=>{
						return v.value == value[value.length - 1]
					})
					item.valueName.push(exist.label)
				} else {
					if(value.length == 0){
						item.valueName = []
					} else {
						if(value.length == 0){
							item.valueName = []
						} else {
							_.each(item._value_bak, (v, i)=>{
								if(value.indexOf(v) === -1){
									item.valueName.splice(i, 1)
								}
							})
						}
						_.each(item._value_bak, (v, i)=>{
							if(value.indexOf(v) === -1){
								item.valueName.splice(i, 1)
							}
						})
					}
					item._value_bak = _.assign([], value)
				}
				item._value_bak = _.assign([], value)
			} 
			
			if(item.onChange){
				if(item.multiple){
					item.onChange(value, item.valueName)
				} else {
					var exist = _.filter(item.optionList, (v)=>{