From 4d08cb2fa0daad4b7593a2b8282466b000194344 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 27 七月 2021 14:29:55 +0800
Subject: [PATCH] 2021-07-27

---
 src/views/printTemplate/mutilform/index.jsx |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/views/printTemplate/mutilform/index.jsx b/src/views/printTemplate/mutilform/index.jsx
index 46471dd..120c3fd 100644
--- a/src/views/printTemplate/mutilform/index.jsx
+++ b/src/views/printTemplate/mutilform/index.jsx
@@ -1,12 +1,14 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Form, Row, Col, Input, InputNumber, Select } from 'antd'
+import { Form, Row, Col, Input, InputNumber, Select, Tooltip, Icon } from 'antd'
 import { formRule } from '@/utils/option.js'
-import FileUpload from '@/tabviews/zshare/fileupload'
+// import FileUpload from '@/tabviews/zshare/fileupload'
+import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
 const { TextArea } = Input
+const FileUpload = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
 
 class MainSearch extends Component {
   static propTpyes = {
@@ -114,11 +116,6 @@
         })
       }
     }
-    this.handleSubmit()
-  }
-
-  updateImg = (val) => {
-    this.props.form.setFieldsValue({ value: val })
     this.handleSubmit()
   }
 
@@ -231,7 +228,12 @@
       } else if (item.type === 'fileupload') {
         fields.push(
           <Col span={24} key={index}>
-            <Form.Item label={item.label}>
+            <Form.Item label={
+              item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}>
+                <Icon type="question-circle" />
+                {item.label}
+              </Tooltip> : item.label
+            }>
               {getFieldDecorator(item.key, {
                 initialValue: item.initval || '',
                 rules: [
@@ -241,12 +243,7 @@
                   }
                 ]
               })(
-                <FileUpload config={{
-                  initval: item.initval || '',
-                  suffix: '',
-                  maxfile: 1,
-                  fileType: 'text'
-                }} onChange={this.updateImg} />
+                <FileUpload type="picture" placement="right" onChange={this.handleSubmit} />
               )}
             </Form.Item>
           </Col>
@@ -254,7 +251,12 @@
       } else if (item.type === 'textarea') {
         fields.push(
           <Col span={24} key={index}>
-            <Form.Item label={item.label} >
+            <Form.Item label={
+              item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}>
+                <Icon type="question-circle" />
+                {item.label}
+              </Tooltip> : item.label
+            }>
               {getFieldDecorator(item.key, {
                 initialValue: item.initval || '',
                 rules: [

--
Gitblit v1.8.0