From 08929dbc66fb157307921026974c459f762209e2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 25 二月 2021 15:31:24 +0800 Subject: [PATCH] 2021-02-25 --- src/views/appmanage/submutilform/index.jsx | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index 8a89cb3..712464f 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -1,7 +1,11 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Radio } from 'antd' +import { Form, Row, Col, Select, Radio, Input } from 'antd' + +import asyncComponent from '@/utils/asyncComponent' import './index.scss' + +const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) class MainSearch extends Component { static propTpyes = { @@ -19,6 +23,11 @@ return new Promise(resolve => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + if (values.favicon && values.favicon.length > 0 && values.favicon[0].status === 'done') { + values.favicon = values.favicon[0].response || values.favicon[0].url || '' + } else { + values.favicon = '' + } resolve(values) } }) @@ -43,13 +52,26 @@ }, wrapperCol: { xs: { span: 24 }, - sm: { span: 12 } + sm: { span: 16 } } } + + let filelist = [] + + if (type === 'edit' && card && card.favicon) { + filelist = [{ + uid: `favicon`, + name: card.favicon.slice(card.favicon.lastIndexOf('/') + 1), + status: 'done', + url: card.favicon, + origin: true + }] + } + return ( <Form {...formItemLayout} className="mob-card-edit-form"> <Row gutter={24}> - <Col span={24}> + <Col span={12}> <Form.Item label="搴旂敤绫诲瀷"> {getFieldDecorator('typename', { initialValue: card ? card.typename : 'mob' @@ -61,7 +83,7 @@ )} </Form.Item> </Col> - <Col span={24}> + <Col span={12}> <Form.Item label="璇█"> {getFieldDecorator('lang', { initialValue: card ? card.lang || 'zh-CN' : 'zh-CN' @@ -73,7 +95,7 @@ )} </Form.Item> </Col> - <Col span={24}> + <Col span={12}> <Form.Item label="鐧诲綍"> {getFieldDecorator('login_types', { initialValue: card ? card.login_types || 'true' : 'true' @@ -85,7 +107,7 @@ )} </Form.Item> </Col> - <Col span={24}> + <Col span={12}> <Form.Item label="鏉冮檺绠$悊"> {getFieldDecorator('role_type', { initialValue: card ? card.role_type || 'true' : 'true' @@ -97,7 +119,7 @@ )} </Form.Item> </Col> - <Col span={24}> + <Col span={12}> <Form.Item label="鐭繛鎺�"> {getFieldDecorator('link_type', { initialValue: card ? card.link_type || 'true' : 'true' @@ -109,7 +131,7 @@ )} </Form.Item> </Col> - <Col span={24}> + <Col span={12}> <Form.Item label="鐨偆"> {getFieldDecorator('css', { initialValue: card ? card.css : 'bg_black_style_blue' @@ -147,6 +169,20 @@ )} </Form.Item> </Col> + <Col span={12}> + <Form.Item label="鏍囬"> + {getFieldDecorator('title', { + initialValue: card ? card.title || '' : '' + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鍥炬爣"> + {getFieldDecorator('favicon', { + initialValue: filelist + })(<FileUpload accept=".jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp,.ico" maxFile={1} fileType={'text'} />)} + </Form.Item> + </Col> </Row> </Form> ) -- Gitblit v1.8.0