diff --git a/web/client/src/components/UploadLocal/index.js b/web/client/src/components/UploadLocal/index.js index a275c81..0af35e2 100644 --- a/web/client/src/components/UploadLocal/index.js +++ b/web/client/src/components/UploadLocal/index.js @@ -50,11 +50,10 @@ class Uploads extends Component { if (value) { // this.setState(value); this.setState({ fileList: value }) - } } - componentWillReceiveProps(np) { + UNSAFE_componentWillReceiveProps(np) { const { dispatch, value: thisEditData, onChange } = this.props; const { value: nextEditData } = np; diff --git a/web/client/src/sections/metadataManagement/components/metadataDatabaseModal.js b/web/client/src/sections/metadataManagement/components/metadataDatabaseModal.js index d005501..c07a620 100644 --- a/web/client/src/sections/metadataManagement/components/metadataDatabaseModal.js +++ b/web/client/src/sections/metadataManagement/components/metadataDatabaseModal.js @@ -12,7 +12,7 @@ const MetadataDatabaseModal = (props) => { if (onConfirm) { let dataSave = JSON.parse(JSON.stringify(values)); dataSave.attributesParam = {}; - metadataModels.map(m => { + metadataModels.filter(mm => mm.modelType === type).map(m => { dataSave.attributesParam[m.attributeCode] = values[m.attributeCode]; delete dataSave[m.attributeCode]; }) @@ -41,16 +41,18 @@ const MetadataDatabaseModal = (props) => { {m.attributeName.substring(0, 10) + '...'} : m.attributeName} name={m.attributeCode} + key={m.attributeCode} rules={rules}> } else if (m.control === '数字输入框') { const rules = [{ required: !m.nullable, message: `${m.attributeName}不可空` }] let maxValue = ''; - if (m.length) { - while (m.length > 0) { + let length = m.length; + if (length) { + while (length > 0) { maxValue += '9' - m.length--; + length--; } } return { {m.attributeName.substring(0, 10) + '...'} : m.attributeName} name={m.attributeCode} + key={m.attributeCode} rules={rules}> @@ -67,6 +70,7 @@ const MetadataDatabaseModal = (props) => { {m.attributeName.substring(0, 10) + '...'} : m.attributeName} name={m.attributeCode} + key={m.attributeCode} rules={[{ required: !m.nullable, message: `${m.attributeName}不可空` }]}> {