king
2021-02-25 08929dbc66fb157307921026974c459f762209e2
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>
    )