Commit 1c617bf0 authored by 满振华's avatar 满振华

修改表单pase

parent a1040280
...@@ -9,11 +9,12 @@ class HandleBehavior { ...@@ -9,11 +9,12 @@ class HandleBehavior {
} }
if (!this.formData) return if (!this.formData) return
this.hiddenFilds(); this.hiddenFilds();
this.formData.map(item => { fi
if (!item.behaviors || !Array.isArray(item.behaviors) || item.behaviors.length === 0) return; // this.formData.map(item => {
const value = this.handleFormaterValue(item.value, item); // if (!item.behaviors || !Array.isArray(item.behaviors) || item.behaviors.length === 0) return;
this.handleBehavior({ currentValue: value, componentData: item, handleType: 'init' }) // const value = this.handleFormaterValue(item.value, item);
}) // this.handleBehavior({ currentValue: value, componentData: item, handleType: 'init' })
// })
return this; return this;
} }
getFormData = () => { getFormData = () => {
...@@ -55,9 +56,9 @@ class HandleBehavior { ...@@ -55,9 +56,9 @@ class HandleBehavior {
const behaviorInstance = HandleClass[behavior.behaviorValue]; const behaviorInstance = HandleClass[behavior.behaviorValue];
if (!behaviorInstance || !behaviorInstance.fun) return; if (!behaviorInstance || !behaviorInstance.fun) return;
let formData = this.formData; let formData = this.formData;
this.formData = behaviorInstance.fun({ value, behavior, behaviors, formData, componentData, handleType }, this.resertValueCallback); this.formData = behaviorInstance.fun({ value, behavior, behaviors, formData, componentData, handleType }, this.resetValueCallback);
} }
resertValueCallback = ({ key, value }) => { resetValueCallback = ({ key, value }) => {
const componentData = this.formData.find(ls => ls.name === key) || {}; const componentData = this.formData.find(ls => ls.name === key) || {};
this.handleBehavior({ currentValue: value, componentData }) this.handleBehavior({ currentValue: value, componentData })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment