瀏覽代碼

删除无用文件

zhuth 6 年之前
父節點
當前提交
4d588d001f
共有 3 個文件被更改,包括 2 次插入66 次删除
  1. 0 45
      src/components/common/colorPicker/index.jsx
  2. 0 19
      src/components/common/colorPicker/index.less
  3. 2 2
      src/index.js

+ 0 - 45
src/components/common/colorPicker/index.jsx

@@ -1,45 +0,0 @@
-import React from 'react'
-import { Input } from 'antd'
-import { RGBToHex, HexToRGB } from '../../../utils/baseUtils'
-import ColorPicker from 'rc-color-picker'
-import 'rc-color-picker/assets/index.css'
-import './index.less'
-
-class InputColorPicker extends React.Component {
-    render() {
-        const { placeholder, value, onChange } = this.props;
-        let colorHex, alpha;
-
-        if((value + '').match(/^#/)) {
-            if(value.length > 3) {
-                colorHex = value;
-            }
-            alpha = 100;
-        }else if(!!(value + '').match(/^rgb[a]{0,1}\(/i)) {
-            let arr = value.split(/[(,)]/),
-                colorRGB = 'RGB(' + (Number((arr[1] || '').trim()) || 0) + ',' + (Number((arr[2] || '').trim()) || 0) + ',' + (Number((arr[3] || '').trim()) || 0) + ',' + (Number((arr[4] || '').trim()) || 1) * 100 + ')'
-            colorHex = RGBToHex(colorRGB);
-            alpha = (Number((arr[4] || '').trim()) || 1) * 100;
-        }
-        return <div className='colorpicker-wrap'>
-            <Input ref={node => this.inputRef = node} placeholder={placeholder} value={value} onChange={e => {
-                typeof onChange === 'function' && onChange(e.target.value);
-            }}/>
-            <ColorPicker
-                animation="slide-up"
-                color={colorHex}
-                alpha={alpha}
-                onChange={(colors) => {
-                    const { alpha, color: colorHex } = colors;
-                    let color = colorHex;
-                    if(alpha !== 100) {
-                        color = HexToRGB(colorHex, alpha)
-                    }
-                    this.inputRef.value = color;
-                    typeof onChange === 'function' && onChange(color)
-                }}
-            />
-        </div> 
-    }
-}
-export default InputColorPicker

+ 0 - 19
src/components/common/colorPicker/index.less

@@ -1,19 +0,0 @@
-.colorpicker-wrap {
-    input {
-        width: 80%;
-        border-radius: @border-radius-base 0 0 @border-radius-base;
-        border-right: none;
-    }
-    .rc-color-picker-wrap  {
-        position: absolute;
-        span {
-            height: 32px;
-            width: 32px; 
-            display: block;
-            position: relative;
-            top: 4px;
-            border-color: #ccc;
-            border-radius: 0 @border-radius-base @border-radius-base 0;
-        }
-    }
-}

+ 2 - 2
src/index.js

@@ -18,8 +18,8 @@ import authority from './models/authority'
 import logs from './models/logs'
 import recent from './models/recent'
 import createLoading from 'dva-loading';
-import './utils/baseUtils'
-import './themes/default/index.less'
+import './utils/baseUtils';
+import './themes/default/index.less';
 
 // 1. Initialize
 const app = dva();