提交 8f2370c0 authored 作者: vipcxj's avatar vipcxj

修复eslint检测出的问题

上级 64aafaad
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<dictionary name="yaohx_169"> <dictionary name="yaohx_169">
<words> <words>
<w>anticon</w> <w>anticon</w>
<w>arcfour</w>
<w>dropdown</w> <w>dropdown</w>
<w>infos</w> <w>infos</w>
<w>lodash</w> <w>lodash</w>
......
...@@ -53,10 +53,6 @@ const makeProps = (meta) => { ...@@ -53,10 +53,6 @@ const makeProps = (meta) => {
return props; return props;
}; };
const getColumn = (columns, name) => {
return (columns || []).find(column => name === column.dataIndex);
};
const getColumnIdx = (columns, name) => { const getColumnIdx = (columns, name) => {
return (columns || []).findIndex(column => name === column.dataIndex); return (columns || []).findIndex(column => name === column.dataIndex);
}; };
......
import React, {Component} from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { DatePicker, Button } from 'antd'; import { DatePicker, Button } from 'antd';
import moment from 'moment'; import moment from 'moment';
......
...@@ -18,7 +18,7 @@ class HeaderPane extends React.Component { ...@@ -18,7 +18,7 @@ class HeaderPane extends React.Component {
dispatch({ type: 'main/fetchDomains' }); dispatch({ type: 'main/fetchDomains' });
} }
render() { render() {
const { dispatch, user, domain, domainList, routes, params, menus } = this.props; const { dispatch, user, domain, domainList, routes, params } = this.props;
const userTitle = ( const userTitle = (
<span> <span>
<Icon type="user" /> <Icon type="user" />
......
...@@ -22,6 +22,9 @@ class Main extends React.Component { ...@@ -22,6 +22,9 @@ class Main extends React.Component {
mode: 'inline', mode: 'inline',
}; };
} }
componentDidMount() {
this.props.dispatch({ type: 'main/fetchModules' });
}
onClick({ keyPath }) { onClick({ keyPath }) {
const paths = keyPath.reverse().join('/'); const paths = keyPath.reverse().join('/');
this.props.dispatch(routerRedux.push(fullPath(`/main/${paths}`))); this.props.dispatch(routerRedux.push(fullPath(`/main/${paths}`)));
...@@ -32,12 +35,6 @@ class Main extends React.Component { ...@@ -32,12 +35,6 @@ class Main extends React.Component {
mode: collapsed ? 'vertical' : 'inline', mode: collapsed ? 'vertical' : 'inline',
}); });
} }
componentDidMount() {
this.props.dispatch({ type: 'main/fetchModules' });
}
render() { render() {
const children = this.props.children; const children = this.props.children;
const { menus } = this.props.main; const { menus } = this.props.main;
......
...@@ -30,7 +30,7 @@ export function addEvent(object, type, handler, remove) { ...@@ -30,7 +30,7 @@ export function addEvent(object, type, handler, remove) {
} }
if (!exists) object[xc].push(handler); if (!exists) object[xc].push(handler);
} }
object[`on${type}`] = function () { object[`on${type}`] = function cb() {
const l = object[xc].length; const l = object[xc].length;
for (let i = 0; i < l; i++) { for (let i = 0; i < l; i++) {
object[xc][i].apply(object, arguments); object[xc][i].apply(object, arguments);
......
const route = (routes) => { const route = (routes) => {
const Wrapper = ({ children }) => { const Wrapper = ({ children }) => {
return children; return children;
}; };
......
/* eslint-disable no-unused-vars,camelcase */
// prng4.js - uses Arcfour as a PRNG // prng4.js - uses Arcfour as a PRNG
function Arcfour() { function Arcfour() {
this.i = 0; this.i = 0;
this.j = 0; this.j = 0;
this.S = new Array(); this.S = [];
} }
// Initialize arcfour context from key, an array of ints, each from [0..255] // Initialize arcfour context from key, an array of ints, each from [0..255]
function ARC4init(key) { function ARC4init(key) {
var i, j, t; let i;
for(i = 0; i < 256; ++i) let j;
this.S[i] = i; let t;
for (i = 0; i < 256; ++i) { this.S[i] = i; }
j = 0; j = 0;
for(i = 0; i < 256; ++i) { for (i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255; j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i]; t = this.S[i];
this.S[i] = this.S[j]; this.S[i] = this.S[j];
...@@ -23,10 +25,9 @@ function ARC4init(key) { ...@@ -23,10 +25,9 @@ function ARC4init(key) {
} }
function ARC4next() { function ARC4next() {
var t;
this.i = (this.i + 1) & 255; this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255; this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i]; const t = this.S[this.i];
this.S[this.i] = this.S[this.j]; this.S[this.i] = this.S[this.j];
this.S[this.j] = t; this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255]; return this.S[(t + this.S[this.i]) & 255];
...@@ -42,4 +43,4 @@ function prng_newstate() { ...@@ -42,4 +43,4 @@ function prng_newstate() {
// Pool size must be a multiple of 4 and greater than 32. // Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init() // An array of bytes the size of the pool will be passed to init()
var rng_psize = 256; const rng_psize = 256;
/* eslint-disable no-undef */
/** /**
* Created by yaohx_169 on 2017/6/29. * Created by yaohx_169 on 2017/6/29.
*/ */
import React from 'react';
import { mount } from 'enzyme';
import chai from 'chai'; import chai from 'chai';
chai.should(); chai.should();
describe('ioc', () => { describe('ioc', () => {
describe('stateful', () => { describe('stateful', () => {
console.log('111');
}); });
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论