From 5088d267c69e87673c85ba302dd9dc62c9da4951 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 16 二月 2020 18:54:49 +0800 Subject: [PATCH] 2020-02-16 --- src/tabviews/tableshare/mutilform/index.jsx | 86 +++++++++--------------------------------- 1 files changed, 19 insertions(+), 67 deletions(-) diff --git a/src/tabviews/tableshare/mutilform/index.jsx b/src/tabviews/tableshare/mutilform/index.jsx index b4fec62..46e8a1c 100644 --- a/src/tabviews/tableshare/mutilform/index.jsx +++ b/src/tabviews/tableshare/mutilform/index.jsx @@ -570,63 +570,25 @@ }) Object.keys(values).forEach(key => { + let _value = '' if (this.state.datatype[key] === 'datetime') { - let _value = '' if (values[key]) { _value = moment(values[key]).format('YYYY-MM-DD HH:mm:ss') } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: _value - }) } else if (this.state.datatype[key] === 'datemonth') { - let _value = '' if (values[key]) { _value = moment(values[key]).format('YYYY-MM') } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: _value - }) } else if (this.state.datatype[key] === 'date') { - let _value = '' if (values[key]) { _value = moment(values[key]).format('YYYY-MM-DD') } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: _value - }) } else if (this.state.datatype[key] === 'number') { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: values[key] - }) + _value = values[key] + } else if (this.state.datatype[key] === 'multiselect') { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: values[key] ? values[key].join(',') : '' - }) + _value = values[key] ? values[key].join(',') : '' + } else if (this.state.datatype[key] === 'fileupload') { let vals = [] @@ -640,33 +602,23 @@ }) } - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: vals.join(',') - }) + _value = vals.join(',') } else if (this.state.datatype[key] === 'text') { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: values[key].replace(/(^\s*|\s*$) | \t* | \v*/ig, '') - }) + _value = values[key].replace(/(^\s*|\s*$) | \t* | \v*/ig, '') + } else { - search.push({ - type: this.state.datatype[key], - readonly: this.state.readtype[key], - readin: this.state.readin[key], - fieldlen: this.state.fieldlen[key], - key: key, - value: values[key] - }) + _value = values[key] + } + + search.push({ + type: this.state.datatype[key], + readonly: this.state.readtype[key], + readin: this.state.readin[key], + fieldlen: this.state.fieldlen[key], + key: key, + value: _value + }) }) resolve(search) -- Gitblit v1.8.0