From 4c9caf3828b22bf1d940b0f3a012a7d2f6f5b67a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 31 八月 2021 18:40:13 +0800
Subject: [PATCH] 2021-08-31

---
 src/tabviews/zshare/actionList/index.scss                    |    2 
 src/menu/picturecontroller/index.jsx                         |   47 ++++++++++++++-
 src/mob/colorsketch/index.jsx                                |   21 ++++++-
 src/views/design/header/index.scss                           |    2 
 src/views/pcdesign/index.jsx                                 |   17 +++++
 src/menu/components/card/cardcellcomponent/index.scss        |    3 
 src/tabviews/zshare/settingcomponent/index.jsx               |    2 
 src/menu/picturecontroller/editform/index.jsx                |   23 ++++++-
 src/tabviews/custom/components/share/normalTable/index.jsx   |    2 
 src/tabviews/custom/index.scss                               |    3 
 src/tabviews/zshare/topSearch/index.scss                     |    4 +
 src/views/menudesign/index.scss                              |    2 
 src/tabviews/custom/components/card/data-card/index.scss     |    2 
 src/views/mobdesign/index.jsx                                |   11 +++
 src/tabviews/custom/components/table/normal-table/index.scss |    4 +
 src/views/menudesign/index.jsx                               |   13 ++++
 16 files changed, 143 insertions(+), 15 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/index.scss b/src/menu/components/card/cardcellcomponent/index.scss
index 6ad726c..3b870c3 100644
--- a/src/menu/components/card/cardcellcomponent/index.scss
+++ b/src/menu/components/card/cardcellcomponent/index.scss
@@ -27,8 +27,9 @@
       background-size: cover;
       background-position: center center;
       height: auto;
-      min-height: 32px;
+      min-height: 28px;
       text-align: center;
+      border-width: 0;
       span {
         font-style: inherit;
         text-decoration: inherit;
diff --git a/src/menu/picturecontroller/editform/index.jsx b/src/menu/picturecontroller/editform/index.jsx
index c739488..778cc0a 100644
--- a/src/menu/picturecontroller/editform/index.jsx
+++ b/src/menu/picturecontroller/editform/index.jsx
@@ -61,7 +61,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 +109,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 +126,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', {
diff --git a/src/menu/picturecontroller/index.jsx b/src/menu/picturecontroller/index.jsx
index cb45a35..638ef3d 100644
--- a/src/menu/picturecontroller/index.jsx
+++ b/src/menu/picturecontroller/index.jsx
@@ -26,6 +26,7 @@
     pageSize: 12,
     filpictures: [],
     filvideos: [],
+    colorlist: [],
     piclist: [],
     vidlist: [],
     picIndex: 1,
@@ -35,13 +36,16 @@
   trigger = () => {
     let pictures = sessionStorage.getItem('app_pictures')
     let videos = sessionStorage.getItem('app_videos')
+    let colorlist = sessionStorage.getItem('app_colors')
 
     try {
       pictures = JSON.parse(pictures)
       videos = JSON.parse(videos)
+      colorlist = JSON.parse(colorlist)
     } catch {
       pictures = []
       videos = []
+      colorlist = []
     }
 
     let filpictures = pictures
@@ -61,6 +65,7 @@
       videoKey: '',
       piclist,
       vidlist,
+      colorlist,
       videos
     })
   }
@@ -95,9 +100,12 @@
           if (card.typecharone === 'image') {
             sessionStorage.setItem('app_pictures', JSON.stringify(result.data || []))
             this.resetPicture(result.data || [])
-          } else {
+          } else if (card.typecharone === 'video') {
             sessionStorage.setItem('app_videos', JSON.stringify(result.data || []))
             this.resetVideo(result.data || [])
+          } else if (card.typecharone === 'color') {
+            sessionStorage.setItem('app_colors', JSON.stringify(result.data || []))
+            this.resetColor(result.data || [])
           }
           this.setState({editvisible: false})
         } else {
@@ -146,9 +154,12 @@
               if (item.typecharone === 'image') {
                 sessionStorage.setItem('app_pictures', JSON.stringify(res.data || []))
                 _this.resetPicture(res.data || [])
-              } else {
+              } else if (item.typecharone === 'video') {
                 sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
                 _this.resetVideo(res.data || [])
+              } else if (item.typecharone === 'color') {
+                sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
+                _this.resetColor(res.data || [])
               }
             } else {
               notification.warning({
@@ -181,6 +192,10 @@
     let vidlist = filvideos.filter((item, index) => index < pageSize)
 
     this.setState({vidIndex: 1, filvideos, vidlist, videos: data})
+  }
+  
+  resetColor = (data) => {
+    this.setState({colorlist: data})
   }
 
   filterPicture = () => {
@@ -216,7 +231,7 @@
   }
   
   render() {
-    const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex } = this.state
+    const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex, colorlist } = this.state
 
     return (
       <div style={{display: 'inline-block'}}>
@@ -298,6 +313,32 @@
               </Row>
               {filvideos.length > pageSize ? <Pagination size="small" current={vidIndex} pageSize={pageSize} onChange={this.changeVidSize} total={filvideos.length} /> : null}
             </TabPane>
+            <TabPane tab="棰滆壊绠$悊" key="color">
+              <Row style={{marginBottom: '15px'}}>
+                <Col span={24}>
+                  鍙坊鍔犲簲鐢ㄤ腑甯哥敤鐨勯鑹诧紝鍙互鏄嫳鏂囦唬鐮併�丠EX鏍煎紡銆丷GB鏍煎紡锛屾渶澶氬彲娣诲姞25绉嶃��
+                  {colorlist.length < 25 ? <Button className="picture-plus mk-green" icon="plus" onClick={() => this.handleSource({typecharone: 'color'})}>
+                    娣诲姞
+                  </Button> : null}
+                </Col>
+              </Row>
+              <Row gutter={16} style={{height: '340px'}}>
+                {colorlist.length > 0 && colorlist.map(item => (
+                  <Col span={4} key={item.id}>
+                    <div className="image-video-box">
+                      <div className="image-video-box-body" style={{background: item.linkurl}}>
+                      </div>
+                      <div className="image-video-control">
+                        <Icon type="copy" onClick={() => this.copySource(item)}/>
+                        <Icon type="delete" onClick={() => this.deleteSource(item)}/>
+                      </div>
+                    </div>
+                    <p className="image-video-remark">{item.remark}</p>
+                  </Col>
+                ))}
+                {!colorlist.length ? <Empty description={null}/> : null}
+              </Row>
+            </TabPane>
           </Tabs>
         </Modal>
         <Modal
diff --git a/src/mob/colorsketch/index.jsx b/src/mob/colorsketch/index.jsx
index 4a92c0e..6070b13 100644
--- a/src/mob/colorsketch/index.jsx
+++ b/src/mob/colorsketch/index.jsx
@@ -20,6 +20,7 @@
   }
   state = {
     color: '',
+    colors: [],
     allowClear: false
   }
 
@@ -34,8 +35,22 @@
     } else if (value) {
       initVal = value
     }
+
+    let _colors = sessionStorage.getItem('app_colors') || []
+    try {
+      _colors = JSON.parse(_colors)
+    } catch {
+      _colors = []
+    }
     
-    this.setState({color: initVal, allowClear: allowClear === true})
+    let colors = presetColors.map((item, i) => {
+      if (_colors[i] && _colors[i].linkurl && !presetColors.includes(_colors[i].linkurl)) {
+        return _colors[i].linkurl
+      }
+      return item
+    })
+    
+    this.setState({color: initVal, allowClear: allowClear === true, colors})
   }
 
   handleChange = (color) => {
@@ -59,11 +74,11 @@
   }
 
   render() {
-    const { color, allowClear } = this.state
+    const { color, allowClear, colors } = this.state
     return (
       <div className="color-sketch-block">
         <Popover content={
-          <SketchPicker color={ color } presetColors={presetColors} onChange={ this.handleChange } />
+          <SketchPicker color={ color } presetColors={colors} onChange={ this.handleChange } />
         } overlayClassName="color-sketch-popover" placement="bottomRight" title="" trigger="click">
           <div className="color-sketch-block-box">
             <div className="color-sketch-block-inner" style={ {background: color} }></div>
diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss
index e8be8a4..041940b 100644
--- a/src/tabviews/custom/components/card/data-card/index.scss
+++ b/src/tabviews/custom/components/card/data-card/index.scss
@@ -11,6 +11,8 @@
     button {
       margin-right: 0px;
       margin-bottom: 0px;
+      min-height: 28px;
+      height: 28px;
     }
   }
 
diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 46eba22..9cabfa1 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -283,7 +283,7 @@
 
       resProps.children = (
         <div>
-          {photos.map((url, i) => (
+          {photos && photos.map((url, i) => (
             <Col key={i} span={cols}>
               <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => {
                 if (!scale) return
diff --git a/src/tabviews/custom/components/table/normal-table/index.scss b/src/tabviews/custom/components/table/normal-table/index.scss
index 1207f33..1d424bb 100644
--- a/src/tabviews/custom/components/table/normal-table/index.scss
+++ b/src/tabviews/custom/components/table/normal-table/index.scss
@@ -14,6 +14,8 @@
     button {
       margin-right: 0px;
       margin-bottom: 0px;
+      min-height: 28px;
+      height: 28px;
     }
   }
   .ant-modal-mask {
@@ -83,6 +85,8 @@
           button {
             margin-right: 0px;
             margin-bottom: 0px;
+            min-height: 28px;
+            height: 28px;
           }
         }
       }
diff --git a/src/tabviews/custom/index.scss b/src/tabviews/custom/index.scss
index a0314f1..fe6390c 100644
--- a/src/tabviews/custom/index.scss
+++ b/src/tabviews/custom/index.scss
@@ -46,7 +46,8 @@
   .button-list.toolbar-button {
     button {
       height: auto;
-      min-height: 32px;
+      min-height: 28px;
+      height: 28px;
     }
   }
 }
diff --git a/src/tabviews/zshare/actionList/index.scss b/src/tabviews/zshare/actionList/index.scss
index 112834c..ea382da 100644
--- a/src/tabviews/zshare/actionList/index.scss
+++ b/src/tabviews/zshare/actionList/index.scss
@@ -7,6 +7,8 @@
     margin-right: 15px;
     margin-bottom: 10px;
     overflow: hidden;
+    min-height: 28px;
+    height: 28px;
   }
 
   .loading-skeleton {
diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx
index 6f7a7d1..ecb0097 100644
--- a/src/tabviews/zshare/settingcomponent/index.jsx
+++ b/src/tabviews/zshare/settingcomponent/index.jsx
@@ -509,7 +509,7 @@
 
   render() {
     const { components, visible } = this.state
-    console.log(components)
+
     return (
       <div className="page-setting-wrap">
         {options.sysType === 'local' ? <Button
diff --git a/src/tabviews/zshare/topSearch/index.scss b/src/tabviews/zshare/topSearch/index.scss
index 90da412..1b8fded 100644
--- a/src/tabviews/zshare/topSearch/index.scss
+++ b/src/tabviews/zshare/topSearch/index.scss
@@ -45,6 +45,10 @@
         top: 5px;
       }
     }
+    .ant-btn {
+      height: 28px;
+      min-height: 28px;
+    }
   }
   .advanced-list {
     font-size: 13px;
diff --git a/src/views/design/header/index.scss b/src/views/design/header/index.scss
index 717384c..d584e42 100644
--- a/src/views/design/header/index.scss
+++ b/src/views/design/header/index.scss
@@ -168,7 +168,7 @@
         font-size: 24px;
         width: 35px;
         height: 35px;
-        line-height: 38px;
+        line-height: 40px;
         border-radius: 35px;
       }
     }
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 937c911..65f4720 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -137,6 +137,8 @@
   }
 
   getAppPictures = () => {
+    if (sessionStorage.getItem('app_videos') || sessionStorage.getItem('app_pictures')) return
+    
     Api.getSystemConfig({
       func: 's_url_db_adduptdel',
       PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
@@ -159,6 +161,17 @@
           sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
         }
       })
+      Api.getSystemConfig({
+        func: 's_url_db_adduptdel',
+        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
+        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
+        typecharone: 'color',
+        type: 'search'
+      }).then(res => {
+        if (res.status) {
+          sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
+        }
+      })
     })
   }
 
diff --git a/src/views/menudesign/index.scss b/src/views/menudesign/index.scss
index b9b5812..178ca87 100644
--- a/src/views/menudesign/index.scss
+++ b/src/views/menudesign/index.scss
@@ -117,7 +117,7 @@
           .ant-card-extra {
             padding: 5px 0;
             button {
-              margin-left: 20px;
+              margin-left: 10px;
             }
             .ant-switch.big {
               min-width: 60px;
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 762e998..843fbb0 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -313,6 +313,17 @@
           sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
         }
       })
+      Api.getSystemConfig({
+        func: 's_url_db_adduptdel',
+        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
+        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
+        typecharone: 'color',
+        type: 'search'
+      }).then(res => {
+        if (res.status) {
+          sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
+        }
+      })
     })
   }
 
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index b54bdbc..4550f57 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -333,6 +333,23 @@
           })
         }
       })
+      Api.getSystemConfig({
+        func: 's_url_db_adduptdel',
+        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
+        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
+        typecharone: 'color',
+        type: 'search'
+      }).then(res => {
+        if (res.status) {
+          sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
+        } else if (!res.status) {
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 5
+          })
+        }
+      })
     })
   }
 

--
Gitblit v1.8.0