Commit 498353d0 by zhaochengxiang

字段类型不应该是中文类型

parent 0ce26e11
...@@ -68,7 +68,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -68,7 +68,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
{ {
(datatypes||[]) && datatypes.map((_datatype, index) => { (datatypes||[]) && datatypes.map((_datatype, index) => {
return ( return (
<Option key={_datatype.name||''}>{_datatype.cnName||''}</Option> <Option key={_datatype.name||''}>{_datatype.name||''}</Option>
); );
}) })
} }
...@@ -274,7 +274,7 @@ const ImportActionTable = (props) => { ...@@ -274,7 +274,7 @@ const ImportActionTable = (props) => {
const row = await form.validateFields(); const row = await form.validateFields();
(row.datatype.parameterNames||[]).forEach((parameterName, index) => { (row.datatype.parameterNames||[]).forEach((parameterName, index) => {
if (!row.datatype.parameterValues[index]) { if (!row.datatype.parameterValues[index] || row.datatype.parameterValues[index]==='') {
row.datatype.parameterValues[index] = 0; row.datatype.parameterValues[index] = 0;
} }
}) })
...@@ -365,7 +365,7 @@ const ImportActionTable = (props) => { ...@@ -365,7 +365,7 @@ const ImportActionTable = (props) => {
let _text = ''; let _text = '';
if (datatype) { if (datatype) {
_text = datatype.cnName||''; _text = datatype.name||'';
(datatype.parameterCnNames||[]).forEach((cnName, index) => { (datatype.parameterCnNames||[]).forEach((cnName, index) => {
_text += ' ' + cnName + ':' + (datatype.parameterValues[index]?datatype.parameterValues[index]:0); _text += ' ' + cnName + ':' + (datatype.parameterValues[index]?datatype.parameterValues[index]:0);
}) })
......
...@@ -18,31 +18,26 @@ class ImportExcel extends React.Component { ...@@ -18,31 +18,26 @@ class ImportExcel extends React.Component {
render() { render() {
const { onChange } = this.props; const { onChange } = this.props;
const { fileList } = this.state;
const uploadProps = { const uploadProps = {
onRemove: file => { onRemove: file => {
this.setState(state => { const index = fileList.indexOf(file);
const index = state.fileList.indexOf(file); const newFileList = fileList.slice();
const newFileList = state.fileList.slice(); newFileList.splice(index, 1);
newFileList.splice(index, 1);
onChange && onChange(newFileList); onChange && onChange(newFileList);
return { this.setState({ fileList: newFileList });
fileList: newFileList,
}
})
}, },
beforeUpload: file => { beforeUpload: file => {
onChange && onChange([file]); onChange && onChange([file]);
this.setState({ fileList: [file] });
this.setState(state => ({
fileList: [file],
}))
return false; return false;
}, },
accept:".xlsx", accept:".xlsx",
fileList: fileList||[]
}; };
return ( return (
......
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