From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 十月 2021 23:17:08 +0800
Subject: [PATCH] 2021-10-21

---
 src/menu/picturecontroller/editform/index.jsx |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/menu/picturecontroller/editform/index.jsx b/src/menu/picturecontroller/editform/index.jsx
index c739488..30a0c83 100644
--- a/src/menu/picturecontroller/editform/index.jsx
+++ b/src/menu/picturecontroller/editform/index.jsx
@@ -19,12 +19,15 @@
   }
 
   handleConfirm = () => {
+    const { card } = this.props
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
           if (values.urls) {
             values.linkurl = values.urls
+          } else if (card.typecharone === 'color' && /^[0-9a-f]{6}$/.test(values.linkurl)) {
+            values.linkurl = '#' + values.linkurl
           }
           resolve(values)
         } else {
@@ -61,7 +64,7 @@
     return (
       <Form {...formItemLayout} className="picture-edit-model-form">
         <Row gutter={24}>
-          {!card.id ? <Col span={24}>
+          {!card.id && card.typecharone !== 'color' ? <Col span={24}>
             <Form.Item label="娣诲姞鏂瑰紡">
               <Radio.Group value={plusType} onChange={(e) => {this.changeType(e.target.value)}} disabled={false}>
                 <Radio value="upload">涓婁紶</Radio>
@@ -109,7 +112,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {!card.id && plusType === 'input' ? <Col span={24}>
+          {!card.id && card.typecharone !== 'color' && plusType === 'input' ? <Col span={24}>
             <Form.Item label="鍦板潃">
               {getFieldDecorator('linkurl', {
                 initialValue: linkurl,
@@ -126,11 +129,28 @@
               })(<TextArea autoSize={{ minRows: 3 }} onPressEnter={() => this.props.inputSubmit()}/>)}
             </Form.Item>
           </Col> : null}
-          {card.id ? <Col span={24}>
+          {card.id && card.typecharone !== 'color' ? <Col span={24}>
             <Form.Item label="鍦板潃">
               <TextArea value={card.linkurl} readOnly={true} autoSize={{ minRows: 3 }} />
             </Form.Item>
           </Col> : null}
+          {card.typecharone === 'color' ? <Col span={24}>
+            <Form.Item label="鑹插��">
+              {getFieldDecorator('linkurl', {
+                initialValue: '',
+                rules: [
+                  {
+                    required: true,
+                    message: '璇峰~鍐欒壊鍊�!'
+                  },
+                  {
+                    max: 100,
+                    message: '鑹插�兼渶澶�100涓瓧绗�!'
+                  }
+                ]
+              })(<Input onPressEnter={() => this.props.inputSubmit()}/>)}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label="澶囨敞">
               {getFieldDecorator('remark', {

--
Gitblit v1.8.0