Commit b588457e authored by 满振华's avatar 满振华

修复表格

parent 2663914e
......@@ -93,11 +93,16 @@ export const GetFormatter = {
return newValue[0].value;
},
NUMBER: (val, config) => {
const newValue = initValue(val);
let newValue = initValue(val);
if (!newValue) {
return undefined;
}
const { precision } = config;
const { precision, unit } = config;
if (unit && unit.code === 'wan') {
let formateVal = Number((newValue[0] || {}).value);
formateVal = formateVal ? formateVal / 10000 : formateVal;
newValue = [{ value: formateVal, text: formateVal }]
}
if (precision >= 0 && isNumber(newValue[0].value)) {
return Number(newValue[0].value).toFixed(precision);
}
......
......@@ -82,8 +82,14 @@ export const SetFormatter = {
RATE: (val) => {
return [{ value: val, text: val }];
},
NUMBER: (val) => {
NUMBER: (val, config) => {
debugger
if (!isNumber(val)) return emptyModel;
const { unit = {} } = config || {}; // 设置单位
if (unit && unit.code === 'wan') {
const newVal = val ? val * 10000 : val;
return [{ value: newVal, text: newVal }]
}
return [{ value: val, text: val }];
},
PERCENTAGE: (val) => {
......
......@@ -132,6 +132,7 @@ class FormWrap extends Component {
};
const transferColumn = transferAttr(columnType, newProps);
const disabled = readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag);
return (
<FormItem key={columnName} label={this.renderLabel(item)}>
{getFieldDecorator(columnName, {
......
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