提交 925394381976bd0d95cf548d34be629d34e27573

作者 愚道
1 个父辈 a96accb7

fix BLOCK_NAME_CAMEL_CASE

@@ -13,9 +13,9 @@ const FormItem = Form.Item; @@ -13,9 +13,9 @@ const FormItem = Form.Item;
13 13
14 /* eslint react/no-array-index-key: 0 */ 14 /* eslint react/no-array-index-key: 0 */
15 15
16 -@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, loading }) => ({  
17 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE,  
18 - loading: loading.models.BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, 16 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  17 + BLOCK_NAME_CAMEL_CASE,
  18 + loading: loading.models.BLOCK_NAME_CAMEL_CASE,
19 })) 19 }))
20 @Form.create({ 20 @Form.create({
21 onValuesChange({ dispatch }, changedValues, allValues) { 21 onValuesChange({ dispatch }, changedValues, allValues) {
@@ -24,7 +24,7 @@ const FormItem = Form.Item; @@ -24,7 +24,7 @@ const FormItem = Form.Item;
24 console.log(changedValues, allValues); 24 console.log(changedValues, allValues);
25 // 模拟查询表单生效 25 // 模拟查询表单生效
26 dispatch({ 26 dispatch({
27 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 27 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
28 payload: { 28 payload: {
29 count: 8, 29 count: 8,
30 }, 30 },
@@ -35,7 +35,7 @@ class CoverCardList extends PureComponent { @@ -35,7 +35,7 @@ class CoverCardList extends PureComponent {
35 componentDidMount() { 35 componentDidMount() {
36 const { dispatch } = this.props; 36 const { dispatch } = this.props;
37 dispatch({ 37 dispatch({
38 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 38 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
39 payload: { 39 payload: {
40 count: 8, 40 count: 8,
41 }, 41 },
@@ -44,7 +44,7 @@ class CoverCardList extends PureComponent { @@ -44,7 +44,7 @@ class CoverCardList extends PureComponent {
44 44
45 render() { 45 render() {
46 const { 46 const {
47 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE: { list = [] }, 47 + BLOCK_NAME_CAMEL_CASE: { list = [] },
48 loading, 48 loading,
49 form, 49 form,
50 } = this.props; 50 } = this.props;
1 import { queryFakeList } from './service'; 1 import { queryFakeList } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -2,7 +2,7 @@ import { routerRedux } from 'dva/router'; @@ -2,7 +2,7 @@ import { routerRedux } from 'dva/router';
2 import { fakeSubmitForm } from './service'; 2 import { fakeSubmitForm } from './service';
3 3
4 export default { 4 export default {
5 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 5 + namespace: 'BLOCK_NAME_CAMEL_CASE',
6 6
7 state: { 7 state: {
8 step: { 8 step: {
@@ -272,8 +272,8 @@ class UpdateForm extends PureComponent { @@ -272,8 +272,8 @@ class UpdateForm extends PureComponent {
272 } 272 }
273 273
274 /* eslint react/no-multi-comp:0 */ 274 /* eslint react/no-multi-comp:0 */
275 -@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, loading }) => ({  
276 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, 275 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  276 + BLOCK_NAME_CAMEL_CASE,
277 loading: loading.models.rule, 277 loading: loading.models.rule,
278 })) 278 }))
279 @Form.create() 279 @Form.create()
@@ -351,7 +351,7 @@ class TableList extends PureComponent { @@ -351,7 +351,7 @@ class TableList extends PureComponent {
351 componentDidMount() { 351 componentDidMount() {
352 const { dispatch } = this.props; 352 const { dispatch } = this.props;
353 dispatch({ 353 dispatch({
354 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 354 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
355 }); 355 });
356 } 356 }
357 357
@@ -376,7 +376,7 @@ class TableList extends PureComponent { @@ -376,7 +376,7 @@ class TableList extends PureComponent {
376 } 376 }
377 377
378 dispatch({ 378 dispatch({
379 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 379 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
380 payload: params, 380 payload: params,
381 }); 381 });
382 }; 382 };
@@ -388,7 +388,7 @@ class TableList extends PureComponent { @@ -388,7 +388,7 @@ class TableList extends PureComponent {
388 formValues: {}, 388 formValues: {},
389 }); 389 });
390 dispatch({ 390 dispatch({
391 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 391 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
392 payload: {}, 392 payload: {},
393 }); 393 });
394 }; 394 };
@@ -408,7 +408,7 @@ class TableList extends PureComponent { @@ -408,7 +408,7 @@ class TableList extends PureComponent {
408 switch (e.key) { 408 switch (e.key) {
409 case 'remove': 409 case 'remove':
410 dispatch({ 410 dispatch({
411 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/remove', 411 + type: 'BLOCK_NAME_CAMEL_CASE/remove',
412 payload: { 412 payload: {
413 key: selectedRows.map(row => row.key), 413 key: selectedRows.map(row => row.key),
414 }, 414 },
@@ -448,7 +448,7 @@ class TableList extends PureComponent { @@ -448,7 +448,7 @@ class TableList extends PureComponent {
448 }); 448 });
449 449
450 dispatch({ 450 dispatch({
451 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetch', 451 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
452 payload: values, 452 payload: values,
453 }); 453 });
454 }); 454 });
@@ -470,7 +470,7 @@ class TableList extends PureComponent { @@ -470,7 +470,7 @@ class TableList extends PureComponent {
470 handleAdd = fields => { 470 handleAdd = fields => {
471 const { dispatch } = this.props; 471 const { dispatch } = this.props;
472 dispatch({ 472 dispatch({
473 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/add', 473 + type: 'BLOCK_NAME_CAMEL_CASE/add',
474 payload: { 474 payload: {
475 desc: fields.desc, 475 desc: fields.desc,
476 }, 476 },
@@ -483,7 +483,7 @@ class TableList extends PureComponent { @@ -483,7 +483,7 @@ class TableList extends PureComponent {
483 handleUpdate = fields => { 483 handleUpdate = fields => {
484 const { dispatch } = this.props; 484 const { dispatch } = this.props;
485 dispatch({ 485 dispatch({
486 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/update', 486 + type: 'BLOCK_NAME_CAMEL_CASE/update',
487 payload: { 487 payload: {
488 name: fields.name, 488 name: fields.name,
489 desc: fields.desc, 489 desc: fields.desc,
@@ -616,7 +616,7 @@ class TableList extends PureComponent { @@ -616,7 +616,7 @@ class TableList extends PureComponent {
616 616
617 render() { 617 render() {
618 const { 618 const {
619 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE: { data }, 619 + BLOCK_NAME_CAMEL_CASE: { data },
620 loading, 620 loading,
621 } = this.props; 621 } = this.props;
622 const { selectedRows, modalVisible, updateModalVisible, stepFormValues } = this.state; 622 const { selectedRows, modalVisible, updateModalVisible, stepFormValues } = this.state;
1 import { queryRule, removeRule, addRule, updateRule } from './service'; 1 import { queryRule, removeRule, addRule, updateRule } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 data: { 7 data: {
@@ -8,9 +8,9 @@ import styles from './style.less'; @@ -8,9 +8,9 @@ import styles from './style.less';
8 8
9 const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; 9 const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
10 10
11 -@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, loading }) => ({  
12 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE,  
13 - submitting: loading.effects['BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/login'], 11 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  12 + BLOCK_NAME_CAMEL_CASE,
  13 + submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/login'],
14 })) 14 }))
15 class LoginPage extends Component { 15 class LoginPage extends Component {
16 state = { 16 state = {
@@ -30,7 +30,7 @@ class LoginPage extends Component { @@ -30,7 +30,7 @@ class LoginPage extends Component {
30 } else { 30 } else {
31 const { dispatch } = this.props; 31 const { dispatch } = this.props;
32 dispatch({ 32 dispatch({
33 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/getCaptcha', 33 + type: 'BLOCK_NAME_CAMEL_CASE/getCaptcha',
34 payload: values.mobile, 34 payload: values.mobile,
35 }) 35 })
36 .then(resolve) 36 .then(resolve)
@@ -44,7 +44,7 @@ class LoginPage extends Component { @@ -44,7 +44,7 @@ class LoginPage extends Component {
44 if (!err) { 44 if (!err) {
45 const { dispatch } = this.props; 45 const { dispatch } = this.props;
46 dispatch({ 46 dispatch({
47 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/login', 47 + type: 'BLOCK_NAME_CAMEL_CASE/login',
48 payload: { 48 payload: {
49 ...values, 49 ...values,
50 type, 50 type,
@@ -64,8 +64,8 @@ class LoginPage extends Component { @@ -64,8 +64,8 @@ class LoginPage extends Component {
64 ); 64 );
65 65
66 render() { 66 render() {
67 - const { BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, submitting } = this.props;  
68 - const { status, type: loginType } = BLOCK_NAME_CAMEL_CASE_CAMEL_CASE; 67 + const { BLOCK_NAME_CAMEL_CASE, submitting } = this.props;
  68 + const { status, type: loginType } = BLOCK_NAME_CAMEL_CASE;
69 const { type, autoLogin } = this.state; 69 const { type, autoLogin } = this.state;
70 return ( 70 return (
71 <div className={styles.main}> 71 <div className={styles.main}>
@@ -6,7 +6,7 @@ import { reloadAuthorized } from './utils/Authorized'; @@ -6,7 +6,7 @@ import { reloadAuthorized } from './utils/Authorized';
6 import { fakeAccountLogin, getFakeCaptcha } from './service'; 6 import { fakeAccountLogin, getFakeCaptcha } from './service';
7 7
8 export default { 8 export default {
9 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 9 + namespace: 'BLOCK_NAME_CAMEL_CASE',
10 10
11 state: { 11 state: {
12 status: undefined, 12 status: undefined,
@@ -34,9 +34,9 @@ const passwordProgressMap = { @@ -34,9 +34,9 @@ const passwordProgressMap = {
34 poor: 'exception', 34 poor: 'exception',
35 }; 35 };
36 36
37 -@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, loading }) => ({  
38 - BLOCK_NAME_CAMEL_CASE_CAMEL_CASE,  
39 - submitting: loading.effects['BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/submit'], 37 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  38 + BLOCK_NAME_CAMEL_CASE,
  39 + submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submit'],
40 })) 40 }))
41 @Form.create() 41 @Form.create()
42 class PAGE_NAME_UPPER_CAMEL_CASE extends Component { 42 class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
@@ -49,9 +49,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -49,9 +49,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
49 }; 49 };
50 50
51 componentDidUpdate() { 51 componentDidUpdate() {
52 - const { form, BLOCK_NAME_CAMEL_CASE_CAMEL_CASE } = this.props; 52 + const { form, BLOCK_NAME_CAMEL_CASE } = this.props;
53 const account = form.getFieldValue('mail'); 53 const account = form.getFieldValue('mail');
54 - if (BLOCK_NAME_CAMEL_CASE_CAMEL_CASE.status === 'ok') { 54 + if (BLOCK_NAME_CAMEL_CASE.status === 'ok') {
55 router.push({ 55 router.push({
56 pathname: '/user/register-result', 56 pathname: '/user/register-result',
57 state: { 57 state: {
@@ -96,7 +96,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -96,7 +96,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
96 if (!err) { 96 if (!err) {
97 const { prefix } = this.state; 97 const { prefix } = this.state;
98 dispatch({ 98 dispatch({
99 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/submit', 99 + type: 'BLOCK_NAME_CAMEL_CASE/submit',
100 payload: { 100 payload: {
101 ...values, 101 ...values,
102 prefix, 102 prefix,
1 import { fakeRegister } from './service'; 1 import { fakeRegister } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 status: undefined, 7 status: undefined,
@@ -39,27 +39,27 @@ const links = [ @@ -39,27 +39,27 @@ const links = [
39 }, 39 },
40 ]; 40 ];
41 41
42 -@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE: { user, project, activities, chart }, loading }) => ({ 42 +@connect(({ BLOCK_NAME_CAMEL_CASE: { user, project, activities, chart }, loading }) => ({
43 currentUser: user.currentUser, 43 currentUser: user.currentUser,
44 project, 44 project,
45 activities, 45 activities,
46 chart, 46 chart,
47 - currentUserLoading: loading.effects['BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetchUserCurrent'],  
48 - projectLoading: loading.effects['BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetchProjectNotice'],  
49 - activitiesLoading: loading.effects['BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/fetchActivitiesList'], 47 + currentUserLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchUserCurrent'],
  48 + projectLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchProjectNotice'],
  49 + activitiesLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchActivitiesList'],
50 })) 50 }))
51 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 51 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
52 componentDidMount() { 52 componentDidMount() {
53 const { dispatch } = this.props; 53 const { dispatch } = this.props;
54 dispatch({ 54 dispatch({
55 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/init', 55 + type: 'BLOCK_NAME_CAMEL_CASE/init',
56 }); 56 });
57 } 57 }
58 58
59 componentWillUnmount() { 59 componentWillUnmount() {
60 const { dispatch } = this.props; 60 const { dispatch } = this.props;
61 dispatch({ 61 dispatch({
62 - type: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE/clear', 62 + type: 'BLOCK_NAME_CAMEL_CASE/clear',
63 }); 63 });
64 } 64 }
65 65
1 import { queryCurrent, queryProjectNotice, queryActivities, fakeChartData } from './service'; 1 import { queryCurrent, queryProjectNotice, queryActivities, fakeChartData } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 state: { 5 state: {
6 user: { 6 user: {
7 currentUser: {}, 7 currentUser: {},
注册登录 后发表评论