⚡ 优化代码
This commit is contained in:
parent
c46bb5f3db
commit
4bb1c2a7cf
|
|
@ -1,371 +1,371 @@
|
||||||
export const iconData = [
|
export const iconData = [
|
||||||
{
|
{
|
||||||
category: 'direction',
|
category: 'direction',
|
||||||
description: '方向性图标',
|
description: '方向性图标',
|
||||||
icons: [
|
icons: [
|
||||||
'step-backward',
|
'step-backward',
|
||||||
'step-forward',
|
'step-forward',
|
||||||
'fast-backward',
|
'fast-backward',
|
||||||
'fast-forward',
|
'fast-forward',
|
||||||
'shrink',
|
'shrink',
|
||||||
'arrows-alt',
|
'arrows-alt',
|
||||||
'down',
|
'down',
|
||||||
'up',
|
'up',
|
||||||
'left',
|
'left',
|
||||||
'right',
|
'right',
|
||||||
'caret-up',
|
'caret-up',
|
||||||
'caret-down',
|
'caret-down',
|
||||||
'caret-left',
|
'caret-left',
|
||||||
'caret-right',
|
'caret-right',
|
||||||
'up-circle',
|
'up-circle',
|
||||||
'down-circle',
|
'down-circle',
|
||||||
'left-circle',
|
'left-circle',
|
||||||
'right-circle',
|
'right-circle',
|
||||||
'double-right',
|
'double-right',
|
||||||
'double-left',
|
'double-left',
|
||||||
'vertical-left',
|
'vertical-left',
|
||||||
'vertical-right',
|
'vertical-right',
|
||||||
'forward',
|
'forward',
|
||||||
'backward',
|
'backward',
|
||||||
'rollback',
|
'rollback',
|
||||||
'enter',
|
'enter',
|
||||||
'retweet',
|
'retweet',
|
||||||
'swap',
|
'swap',
|
||||||
'swap-left',
|
'swap-left',
|
||||||
'swap-right',
|
'swap-right',
|
||||||
'arrow-up',
|
'arrow-up',
|
||||||
'arrow-down',
|
'arrow-down',
|
||||||
'arrow-left',
|
'arrow-left',
|
||||||
'arrow-right',
|
'arrow-right',
|
||||||
'play-circle',
|
'play-circle',
|
||||||
'up-square',
|
'up-square',
|
||||||
'down-square',
|
'down-square',
|
||||||
'left-square',
|
'left-square',
|
||||||
'right-square',
|
'right-square',
|
||||||
'login',
|
'login',
|
||||||
'logout',
|
'logout',
|
||||||
'menu-fold',
|
'menu-fold',
|
||||||
'menu-unfold',
|
'menu-unfold',
|
||||||
'border-bottom',
|
'border-bottom',
|
||||||
'border-horizontal',
|
'border-horizontal',
|
||||||
'border-inner',
|
'border-inner',
|
||||||
'border-left',
|
'border-left',
|
||||||
'border-right',
|
'border-right',
|
||||||
'border-top',
|
'border-top',
|
||||||
'border-verticle',
|
'border-verticle',
|
||||||
'pic-center',
|
'pic-center',
|
||||||
'pic-left',
|
'pic-left',
|
||||||
'pic-right',
|
'pic-right',
|
||||||
'radius-bottomleft',
|
'radius-bottomleft',
|
||||||
'radius-bottomright',
|
'radius-bottomright',
|
||||||
'radius-upleft',
|
'radius-upleft',
|
||||||
'fullscreen',
|
'fullscreen',
|
||||||
'fullscreen-exit',
|
'fullscreen-exit',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: 'suggestion',
|
category: 'suggestion',
|
||||||
description: '提示建议性图标',
|
description: '提示建议性图标',
|
||||||
icons: [
|
icons: [
|
||||||
'question',
|
'question',
|
||||||
'question-circle',
|
'question-circle',
|
||||||
'plus',
|
'plus',
|
||||||
'plus-circle',
|
'plus-circle',
|
||||||
'pause',
|
'pause',
|
||||||
'pause-circle',
|
'pause-circle',
|
||||||
'minus',
|
'minus',
|
||||||
'minus-circle',
|
'minus-circle',
|
||||||
'plus-square',
|
'plus-square',
|
||||||
'minus-square',
|
'minus-square',
|
||||||
'info',
|
'info',
|
||||||
'info-circle',
|
'info-circle',
|
||||||
'exclamation',
|
'exclamation',
|
||||||
'exclamation-circle',
|
'exclamation-circle',
|
||||||
'close',
|
'close',
|
||||||
'close-circle',
|
'close-circle',
|
||||||
'close-square',
|
'close-square',
|
||||||
'check',
|
'check',
|
||||||
'check-circle',
|
'check-circle',
|
||||||
'check-square',
|
'check-square',
|
||||||
'clock-circle',
|
'clock-circle',
|
||||||
'warning',
|
'warning',
|
||||||
'issues-close',
|
'issues-close',
|
||||||
'stop',
|
'stop',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: 'edit',
|
category: 'edit',
|
||||||
description: '编辑类图标',
|
description: '编辑类图标',
|
||||||
icons: [
|
icons: [
|
||||||
'edit',
|
'edit',
|
||||||
'form',
|
'form',
|
||||||
'copy',
|
'copy',
|
||||||
'scissor',
|
'scissor',
|
||||||
'delete',
|
'delete',
|
||||||
'snippets',
|
'snippets',
|
||||||
'diff',
|
'diff',
|
||||||
'highlight',
|
'highlight',
|
||||||
'align-center',
|
'align-center',
|
||||||
'align-left',
|
'align-left',
|
||||||
'align-right',
|
'align-right',
|
||||||
'bg-colors',
|
'bg-colors',
|
||||||
'bold',
|
'bold',
|
||||||
'italic',
|
'italic',
|
||||||
'underline',
|
'underline',
|
||||||
'strikethrough',
|
'strikethrough',
|
||||||
'redo',
|
'redo',
|
||||||
'undo',
|
'undo',
|
||||||
'zoom-in',
|
'zoom-in',
|
||||||
'zoom-out',
|
'zoom-out',
|
||||||
'font-colors',
|
'font-colors',
|
||||||
'font-size',
|
'font-size',
|
||||||
'line-height',
|
'line-height',
|
||||||
'colum-height',
|
'colum-height',
|
||||||
'dash',
|
'dash',
|
||||||
'small-dash',
|
'small-dash',
|
||||||
'sort-ascending',
|
'sort-ascending',
|
||||||
'sort-descending',
|
'sort-descending',
|
||||||
'drag',
|
'drag',
|
||||||
'ordered-list',
|
'ordered-list',
|
||||||
'radius-setting',
|
'radius-setting',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: 'data:',
|
category: 'data:',
|
||||||
description: '数据类图标',
|
description: '数据类图标',
|
||||||
icons: [
|
icons: [
|
||||||
'area-chart',
|
'area-chart',
|
||||||
'pie-chart',
|
'pie-chart',
|
||||||
'bar-chart',
|
'bar-chart',
|
||||||
'dot-chart',
|
'dot-chart',
|
||||||
'line-chart',
|
'line-chart',
|
||||||
'radar-chart',
|
'radar-chart',
|
||||||
'heat-map',
|
'heat-map',
|
||||||
'fall',
|
'fall',
|
||||||
'rise',
|
'rise',
|
||||||
'stock',
|
'stock',
|
||||||
'box-plot',
|
'box-plot',
|
||||||
'fund',
|
'fund',
|
||||||
'sliders',
|
'sliders',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: 'other',
|
category: 'other',
|
||||||
description: '网站通用图标',
|
description: '网站通用图标',
|
||||||
icons: [
|
icons: [
|
||||||
'lock',
|
'lock',
|
||||||
'unlock',
|
'unlock',
|
||||||
'bars',
|
'bars',
|
||||||
'book',
|
'book',
|
||||||
'calendar',
|
'calendar',
|
||||||
'cloud',
|
'cloud',
|
||||||
'cloud-download',
|
'cloud-download',
|
||||||
'code',
|
'code',
|
||||||
'copy',
|
'copy',
|
||||||
'credit-card',
|
'credit-card',
|
||||||
'delete',
|
'delete',
|
||||||
'desktop',
|
'desktop',
|
||||||
'download',
|
'download',
|
||||||
'ellipsis',
|
'ellipsis',
|
||||||
'file',
|
'file',
|
||||||
'file-text',
|
'file-text',
|
||||||
'file-unknown',
|
'file-unknown',
|
||||||
'file-pdf',
|
'file-pdf',
|
||||||
'file-word',
|
'file-word',
|
||||||
'file-excel',
|
'file-excel',
|
||||||
'file-jpg',
|
'file-jpg',
|
||||||
'file-ppt',
|
'file-ppt',
|
||||||
'file-markdown',
|
'file-markdown',
|
||||||
'file-add',
|
'file-add',
|
||||||
'folder',
|
'folder',
|
||||||
'folder-open',
|
'folder-open',
|
||||||
'folder-add',
|
'folder-add',
|
||||||
'hdd',
|
'hdd',
|
||||||
'frown',
|
'frown',
|
||||||
'meh',
|
'meh',
|
||||||
'smile',
|
'smile',
|
||||||
'inbox',
|
'inbox',
|
||||||
'laptop',
|
'laptop',
|
||||||
'appstore',
|
'appstore',
|
||||||
'link',
|
'link',
|
||||||
'mail',
|
'mail',
|
||||||
'mobile',
|
'mobile',
|
||||||
'notification',
|
'notification',
|
||||||
'paper-clip',
|
'paper-clip',
|
||||||
'picture',
|
'picture',
|
||||||
'poweroff',
|
'poweroff',
|
||||||
'reload',
|
'reload',
|
||||||
'search',
|
'search',
|
||||||
'setting',
|
'setting',
|
||||||
'share-alt',
|
'share-alt',
|
||||||
'shopping-cart',
|
'shopping-cart',
|
||||||
'tablet',
|
'tablet',
|
||||||
'tag',
|
'tag',
|
||||||
'tags',
|
'tags',
|
||||||
'to-top',
|
'to-top',
|
||||||
'upload',
|
'upload',
|
||||||
'user',
|
'user',
|
||||||
'video-camera',
|
'video-camera',
|
||||||
'home',
|
'home',
|
||||||
'loading',
|
'loading',
|
||||||
'loading-3-quarters',
|
'loading-3-quarters',
|
||||||
'cloud-upload',
|
'cloud-upload',
|
||||||
'star',
|
'star',
|
||||||
'heart',
|
'heart',
|
||||||
'environment',
|
'environment',
|
||||||
'eye',
|
'eye',
|
||||||
'eye-invisible',
|
'eye-invisible',
|
||||||
'camera',
|
'camera',
|
||||||
'save',
|
'save',
|
||||||
'team',
|
'team',
|
||||||
'solution',
|
'solution',
|
||||||
'phone',
|
'phone',
|
||||||
'filter',
|
'filter',
|
||||||
'exception',
|
'exception',
|
||||||
'export',
|
'export',
|
||||||
'customer-service',
|
'customer-service',
|
||||||
'qrcode',
|
'qrcode',
|
||||||
'scan',
|
'scan',
|
||||||
'like',
|
'like',
|
||||||
'dislike',
|
'dislike',
|
||||||
'message',
|
'message',
|
||||||
'pay-circle',
|
'pay-circle',
|
||||||
'calculator',
|
'calculator',
|
||||||
'pushpin',
|
'pushpin',
|
||||||
'bulb',
|
'bulb',
|
||||||
'select',
|
'select',
|
||||||
'switcher',
|
'switcher',
|
||||||
'rocket',
|
'rocket',
|
||||||
'bell',
|
'bell',
|
||||||
'disconnect',
|
'disconnect',
|
||||||
'database',
|
'database',
|
||||||
'compass',
|
'compass',
|
||||||
'barcode',
|
'barcode',
|
||||||
'hourglass',
|
'hourglass',
|
||||||
'key',
|
'key',
|
||||||
'flag',
|
'flag',
|
||||||
'layout',
|
'layout',
|
||||||
'printer',
|
'printer',
|
||||||
'sound',
|
'sound',
|
||||||
'usb',
|
'usb',
|
||||||
'skin',
|
'skin',
|
||||||
'tool',
|
'tool',
|
||||||
'sync',
|
'sync',
|
||||||
'wifi',
|
'wifi',
|
||||||
'car',
|
'car',
|
||||||
'schedule',
|
'schedule',
|
||||||
'user-add',
|
'user-add',
|
||||||
'user-delete',
|
'user-delete',
|
||||||
'usergroup-add',
|
'usergroup-add',
|
||||||
'usergroup-delete',
|
'usergroup-delete',
|
||||||
'man',
|
'man',
|
||||||
'woman',
|
'woman',
|
||||||
'shop',
|
'shop',
|
||||||
'gift',
|
'gift',
|
||||||
'idcard',
|
'idcard',
|
||||||
'medicine-box',
|
'medicine-box',
|
||||||
'red-envelope',
|
'red-envelope',
|
||||||
'coffee',
|
'coffee',
|
||||||
'copyright',
|
'copyright',
|
||||||
'trademark',
|
'trademark',
|
||||||
'safety',
|
'safety',
|
||||||
'wallet',
|
'wallet',
|
||||||
'bank',
|
'bank',
|
||||||
'trophy',
|
'trophy',
|
||||||
'contacts',
|
'contacts',
|
||||||
'global',
|
'global',
|
||||||
'shake',
|
'shake',
|
||||||
'api',
|
'api',
|
||||||
'fork',
|
'fork',
|
||||||
'dashboard',
|
'dashboard',
|
||||||
'table',
|
'table',
|
||||||
'profile',
|
'profile',
|
||||||
'alert',
|
'alert',
|
||||||
'audit',
|
'audit',
|
||||||
'branches',
|
'branches',
|
||||||
'build',
|
'build',
|
||||||
'border',
|
'border',
|
||||||
'crown',
|
'crown',
|
||||||
'experiment',
|
'experiment',
|
||||||
'fire',
|
'fire',
|
||||||
'money-collect',
|
'money-collect',
|
||||||
'property-safety',
|
'property-safety',
|
||||||
'read',
|
'read',
|
||||||
'reconciliation',
|
'reconciliation',
|
||||||
'rest',
|
'rest',
|
||||||
'security-scan',
|
'security-scan',
|
||||||
'insurance',
|
'insurance',
|
||||||
'interation',
|
'interation',
|
||||||
'safety-certificate',
|
'safety-certificate',
|
||||||
'project',
|
'project',
|
||||||
'thunderbolt',
|
'thunderbolt',
|
||||||
'block',
|
'block',
|
||||||
'cluster',
|
'cluster',
|
||||||
'deployment-unit',
|
'deployment-unit',
|
||||||
'dollar',
|
'dollar',
|
||||||
'euro',
|
'euro',
|
||||||
'pound',
|
'pound',
|
||||||
'file-done',
|
'file-done',
|
||||||
'file-exclamation',
|
'file-exclamation',
|
||||||
'file-protect',
|
'file-protect',
|
||||||
'file-search',
|
'file-search',
|
||||||
'file-sync',
|
'file-sync',
|
||||||
'gateway',
|
'gateway',
|
||||||
'gold',
|
'gold',
|
||||||
'robot',
|
'robot',
|
||||||
'shopping',
|
'shopping',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
category: 'logo',
|
category: 'logo',
|
||||||
description: '品牌和标识图标',
|
description: '品牌和标识图标',
|
||||||
icons: [
|
icons: [
|
||||||
'android',
|
'android',
|
||||||
'apple',
|
'apple',
|
||||||
'windows',
|
'windows',
|
||||||
'ie',
|
'ie',
|
||||||
'chrome',
|
'chrome',
|
||||||
'github',
|
'github',
|
||||||
'aliwangwang',
|
'aliwangwang',
|
||||||
'dingding',
|
'dingding',
|
||||||
'weibo-square',
|
'weibo-square',
|
||||||
'weibo-circle',
|
'weibo-circle',
|
||||||
'taobao-circle',
|
'taobao-circle',
|
||||||
'html5',
|
'html5',
|
||||||
'weibo',
|
'weibo',
|
||||||
'twitter',
|
'twitter',
|
||||||
'wechat',
|
'wechat',
|
||||||
'youtube',
|
'youtube',
|
||||||
'alipay-circle',
|
'alipay-circle',
|
||||||
'taobao',
|
'taobao',
|
||||||
'skype',
|
'skype',
|
||||||
'qq',
|
'qq',
|
||||||
'medium-workmark',
|
'medium-workmark',
|
||||||
'gitlab',
|
'gitlab',
|
||||||
'medium',
|
'medium',
|
||||||
'linkedin',
|
'linkedin',
|
||||||
'google-plus',
|
'google-plus',
|
||||||
'dropbox',
|
'dropbox',
|
||||||
'facebook',
|
'facebook',
|
||||||
'codepen',
|
'codepen',
|
||||||
'code-sandbox',
|
'code-sandbox',
|
||||||
'amazon',
|
'amazon',
|
||||||
'google',
|
'google',
|
||||||
'codepen-circle',
|
'codepen-circle',
|
||||||
'alipay',
|
'alipay',
|
||||||
'ant-design',
|
'ant-design',
|
||||||
'aliyun',
|
'aliyun',
|
||||||
'zhihu',
|
'zhihu',
|
||||||
'slack',
|
'slack',
|
||||||
'slack-square',
|
'slack-square',
|
||||||
'behance',
|
'behance',
|
||||||
'behance-square',
|
'behance-square',
|
||||||
'dribbble',
|
'dribbble',
|
||||||
'dribbble-square',
|
'dribbble-square',
|
||||||
'instagram',
|
'instagram',
|
||||||
'yuque',
|
'yuque',
|
||||||
'alibaba',
|
'alibaba',
|
||||||
'yahoo',
|
'yahoo',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import { connect } from 'dva';
|
import { connect } from 'dva';
|
||||||
import { Card, Col, Icon, Row, Tabs } from 'antd';
|
import { Card, Col, Icon, Row, Tabs } from 'antd';
|
||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import styles from '../../../../layouts/Sword.less';
|
import styles from '../../layouts/Sword.less';
|
||||||
import { iconData } from './IconData';
|
import { iconData } from './IconData';
|
||||||
import { MENU_SELECT_ICON } from '../../../../actions/menu';
|
import { MENU_SELECT_ICON } from '../../actions/menu';
|
||||||
|
|
||||||
const { TabPane } = Tabs;
|
const { TabPane } = Tabs;
|
||||||
|
|
||||||
@connect(({ menu }) => ({
|
@connect(({ menu }) => ({
|
||||||
menu,
|
menu,
|
||||||
}))
|
}))
|
||||||
class IconCategory extends PureComponent {
|
class Index extends PureComponent {
|
||||||
handelClick = type => {
|
handelClick = type => {
|
||||||
const { onCancel, dispatch } = this.props;
|
const { onCancel, dispatch } = this.props;
|
||||||
dispatch(MENU_SELECT_ICON(type.icon));
|
dispatch(MENU_SELECT_ICON(type.icon));
|
||||||
|
|
@ -42,4 +42,4 @@ class IconCategory extends PureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default IconCategory;
|
export default Index;
|
||||||
|
|
@ -17,7 +17,7 @@ import Panel from '../../../components/Panel';
|
||||||
import styles from '../../../layouts/Sword.less';
|
import styles from '../../../layouts/Sword.less';
|
||||||
import func from '../../../utils/Func';
|
import func from '../../../utils/Func';
|
||||||
import { MENU_INIT, MENU_SUBMIT, MENU_DETAIL, MENU_CLEAR_DETAIL } from '../../../actions/menu';
|
import { MENU_INIT, MENU_SUBMIT, MENU_DETAIL, MENU_CLEAR_DETAIL } from '../../../actions/menu';
|
||||||
import IconCategory from './IconPreview/IconCategory';
|
import IconPreview from '../../../components/IconPreview';
|
||||||
|
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
const { TextArea, Search } = Input;
|
const { TextArea, Search } = Input;
|
||||||
|
|
@ -288,7 +288,7 @@ class MenuAdd extends PureComponent {
|
||||||
</Card>
|
</Card>
|
||||||
</Form>
|
</Form>
|
||||||
<Modal width={900} visible={visible} onCancel={this.handleCancel} footer={null}>
|
<Modal width={900} visible={visible} onCancel={this.handleCancel} footer={null}>
|
||||||
<IconCategory onCancel={this.handleCancel} />
|
<IconPreview onCancel={this.handleCancel} />
|
||||||
</Modal>
|
</Modal>
|
||||||
</Panel>
|
</Panel>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import Panel from '../../../components/Panel';
|
||||||
import styles from '../../../layouts/Sword.less';
|
import styles from '../../../layouts/Sword.less';
|
||||||
import { MENU_DETAIL, MENU_INIT, MENU_SUBMIT } from '../../../actions/menu';
|
import { MENU_DETAIL, MENU_INIT, MENU_SUBMIT } from '../../../actions/menu';
|
||||||
import func from '../../../utils/Func';
|
import func from '../../../utils/Func';
|
||||||
import IconCategory from './IconPreview/IconCategory';
|
import IconPreview from '../../../components/IconPreview';
|
||||||
|
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
const { TextArea, Search } = Input;
|
const { TextArea, Search } = Input;
|
||||||
|
|
@ -306,7 +306,7 @@ class MenuEdit extends PureComponent {
|
||||||
</Card>
|
</Card>
|
||||||
</Form>
|
</Form>
|
||||||
<Modal width={900} visible={visible} onCancel={this.handleCancel} footer={null}>
|
<Modal width={900} visible={visible} onCancel={this.handleCancel} footer={null}>
|
||||||
<IconCategory onCancel={this.handleCancel} />
|
<IconPreview onCancel={this.handleCancel} />
|
||||||
</Modal>
|
</Modal>
|
||||||
</Panel>
|
</Panel>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user