提交 841ebe1a authored 作者: 徐立's avatar 徐立

合并

上级 2970368c
...@@ -73,6 +73,7 @@ function getBase64(value) { ...@@ -73,6 +73,7 @@ function getBase64(value) {
return value ? base64.encode(new Buffer(value)) : null; return value ? base64.encode(new Buffer(value)) : null;
} }
const codeMessage = { const codeMessage = {
200: '服务器成功返回请求的数据。', 200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。', 201: '新建或修改数据成功。',
...@@ -117,6 +118,7 @@ const errorHandler = error => { ...@@ -117,6 +118,7 @@ const errorHandler = error => {
let oldProps = {} let oldProps = {}
const normFile = (e) => { const normFile = (e) => {
console.log(e)
if (Array.isArray(e)) { if (Array.isArray(e)) {
return e; return e;
} }
...@@ -2710,16 +2712,33 @@ export default class tableCom extends Component { ...@@ -2710,16 +2712,33 @@ export default class tableCom extends Component {
} }
break; break;
case 'ImgUploadCom': case 'ImgUploadCom':
cm = getFieldDecorator("img$" + dataColumn.base52, { cm = getFieldDecorator("img$" + dataColumn.base52, {
valuePropName: 'fileList[0]', valuePropName: 'fileList[0]',
getValueFromEvent: normFile, getValueFromEvent: normFile,
})(<Upload.Dragger disabled={disabled} accept={"image/*"} url={this.state.url || initValue} showUploadList={false} name="file" action={config.uploadUrl} onChange={info => this.changeUrl(info, dataColumn.base52)} multiple={false} style={{ padding: 0 }}> })(
{this.state.url || initValue ? <img src={config.httpServer + (this.state.url || initValue)} style={{ height: json.height, width: json.width }} /> : <div style={{ height: json.height, width: json.width }}> <Upload.Dragger
disabled={disabled}
</div>} accept={"image/*"}
url={this.state.url || initValue}
</Upload.Dragger>); showUploadList={false}
name="file"
action={config.uploadUrl}
onChange={info => this.changeUrl(info, dataColumn.base52)}
multiple={false}
style={{ padding: 0 }}>
{this.state.url || initValue ?
<img
src={config.httpServer + (this.state.url || initValue)}
style={{ height: json.height, width: json.width }} />
: <div
style={{
height: json.height,
width: json.width }}>
</div>}
</Upload.Dragger>
);
if (get === 'mobile' && json.isLabel && title) { if (get === 'mobile' && json.isLabel && title) {
cm = <Form.Item cm = <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论