提交 31ef44097a7c1946b0595c227ce9f4892ae49ed5

作者 愚道
1 个父辈 ec5087fb

use BLOCK_NAME_CAMEL_CASE as the model name

正在显示 35 个修改的文件 包含 114 行增加114 行删除
@@ -31,9 +31,9 @@ const operationTabList = [ @@ -31,9 +31,9 @@ const operationTabList = [
31 }, 31 },
32 ]; 32 ];
33 33
34 -@connect(({ loading, BLOCK_NAME }) => ({  
35 - currentUser: BLOCK_NAME.currentUser,  
36 - currentUserLoading: loading.effects['BLOCK_NAME/fetchCurrent'], 34 +@connect(({ loading, BLOCK_NAME_CAMEL_CASE }) => ({
  35 + currentUser: BLOCK_NAME_CAMEL_CASE.currentUser,
  36 + currentUserLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchCurrent'],
37 })) 37 }))
38 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 38 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
39 static getDerivedStateFromProps(props, state) { 39 static getDerivedStateFromProps(props, state) {
@@ -58,7 +58,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -58,7 +58,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
58 componentDidMount() { 58 componentDidMount() {
59 const { dispatch } = this.props; 59 const { dispatch } = this.props;
60 dispatch({ 60 dispatch({
61 - type: 'BLOCK_NAME/fetchCurrent', 61 + type: 'BLOCK_NAME_CAMEL_CASE/fetchCurrent',
62 }); 62 });
63 } 63 }
64 64
1 import { query as queryUsers, queryCurrent } from './service'; 1 import { query as queryUsers, queryCurrent } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -11,8 +11,8 @@ import NotificationView from './components/notification'; @@ -11,8 +11,8 @@ import NotificationView from './components/notification';
11 11
12 const { Item } = Menu; 12 const { Item } = Menu;
13 13
14 -@connect(({ BLOCK_NAME }) => ({  
15 - currentUser: BLOCK_NAME.currentUser, 14 +@connect(({ BLOCK_NAME_CAMEL_CASE }) => ({
  15 + currentUser: BLOCK_NAME_CAMEL_CASE.currentUser,
16 })) 16 }))
17 class PAGE_NAME_UPPER_CAMEL_CASE extends Component { 17 class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
18 constructor(props) { 18 constructor(props) {
@@ -54,7 +54,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -54,7 +54,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
54 componentDidMount() { 54 componentDidMount() {
55 const { dispatch } = this.props; 55 const { dispatch } = this.props;
56 dispatch({ 56 dispatch({
57 - type: 'BLOCK_NAME/fetchCurrent', 57 + type: 'BLOCK_NAME_CAMEL_CASE/fetchCurrent',
58 }); 58 });
59 window.addEventListener('resize', this.resize); 59 window.addEventListener('resize', this.resize);
60 this.resize(); 60 this.resize();
1 import { query as queryUsers, queryCurrent, queryProvince, queryCity } from './service'; 1 import { query as queryUsers, queryCurrent, queryProvince, queryCity } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -58,7 +58,7 @@ const tableData = [ @@ -58,7 +58,7 @@ const tableData = [
58 ]; 58 ];
59 59
60 @connect(({ loading }) => ({ 60 @connect(({ loading }) => ({
61 - submitting: loading.effects['BLOCK_NAME/submitAdvancedForm'], 61 + submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitAdvancedForm'],
62 })) 62 }))
63 @Form.create() 63 @Form.create()
64 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 64 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
@@ -139,7 +139,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -139,7 +139,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
139 if (!error) { 139 if (!error) {
140 // submit the values 140 // submit the values
141 dispatch({ 141 dispatch({
142 - type: 'BLOCK_NAME/submitAdvancedForm', 142 + type: 'BLOCK_NAME_CAMEL_CASE/submitAdvancedForm',
143 payload: values, 143 payload: values,
144 }); 144 });
145 } 145 }
@@ -2,7 +2,7 @@ import { message } from 'antd'; @@ -2,7 +2,7 @@ import { message } from 'antd';
2 import { fakeSubmitForm } from './service'; 2 import { fakeSubmitForm } from './service';
3 3
4 export default { 4 export default {
5 - namespace: 'BLOCK_NAME', 5 + namespace: 'BLOCK_NAME_CAMEL_CASE',
6 6
7 state: {}, 7 state: {},
8 8
@@ -180,9 +180,9 @@ const columns = [ @@ -180,9 +180,9 @@ const columns = [
180 }, 180 },
181 ]; 181 ];
182 182
183 -@connect(({ BLOCK_NAME, loading }) => ({  
184 - BLOCK_NAME,  
185 - loading: loading.effects['BLOCK_NAME/fetchAdvanced'], 183 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  184 + BLOCK_NAME_CAMEL_CASE,
  185 + loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchAdvanced'],
186 })) 186 }))
187 class PAGE_NAME_UPPER_CAMEL_CASE extends Component { 187 class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
188 state = { 188 state = {
@@ -193,7 +193,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -193,7 +193,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
193 componentDidMount() { 193 componentDidMount() {
194 const { dispatch } = this.props; 194 const { dispatch } = this.props;
195 dispatch({ 195 dispatch({
196 - type: 'BLOCK_NAME/fetchAdvanced', 196 + type: 'BLOCK_NAME_CAMEL_CASE/fetchAdvanced',
197 }); 197 });
198 198
199 this.setStepDirection(); 199 this.setStepDirection();
@@ -227,8 +227,8 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -227,8 +227,8 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
227 227
228 render() { 228 render() {
229 const { stepDirection, operationkey } = this.state; 229 const { stepDirection, operationkey } = this.state;
230 - const { BLOCK_NAME, loading } = this.props;  
231 - const { advancedOperation1, advancedOperation2, advancedOperation3 } = BLOCK_NAME; 230 + const { BLOCK_NAME_CAMEL_CASE, loading } = this.props;
  231 + const { advancedOperation1, advancedOperation2, advancedOperation3 } = BLOCK_NAME_CAMEL_CASE;
232 const contentList = { 232 const contentList = {
233 tab1: ( 233 tab1: (
234 <Table 234 <Table
1 import { queryAdvancedProfile } from './service'; 1 import { queryAdvancedProfile } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 advancedOperation1: [], 7 advancedOperation1: [],
@@ -13,9 +13,9 @@ const TopSearch = React.lazy(() => import('./components/TopSearch')); @@ -13,9 +13,9 @@ const TopSearch = React.lazy(() => import('./components/TopSearch'));
13 const ProportionSales = React.lazy(() => import('./components/ProportionSales')); 13 const ProportionSales = React.lazy(() => import('./components/ProportionSales'));
14 const OfflineData = React.lazy(() => import('./components/OfflineData')); 14 const OfflineData = React.lazy(() => import('./components/OfflineData'));
15 15
16 -@connect(({ BLOCK_NAME, loading }) => ({  
17 - BLOCK_NAME,  
18 - loading: loading.effects['BLOCK_NAME/fetch'], 16 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  17 + BLOCK_NAME_CAMEL_CASE,
  18 + loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetch'],
19 })) 19 }))
20 class PAGE_NAME_UPPER_CAMEL_CASE extends Component { 20 class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
21 state = { 21 state = {
@@ -28,7 +28,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -28,7 +28,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
28 const { dispatch } = this.props; 28 const { dispatch } = this.props;
29 this.reqRef = requestAnimationFrame(() => { 29 this.reqRef = requestAnimationFrame(() => {
30 dispatch({ 30 dispatch({
31 - type: 'BLOCK_NAME/fetch', 31 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
32 }); 32 });
33 }); 33 });
34 } 34 }
@@ -36,7 +36,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -36,7 +36,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
36 componentWillUnmount() { 36 componentWillUnmount() {
37 const { dispatch } = this.props; 37 const { dispatch } = this.props;
38 dispatch({ 38 dispatch({
39 - type: 'BLOCK_NAME/clear', 39 + type: 'BLOCK_NAME_CAMEL_CASE/clear',
40 }); 40 });
41 cancelAnimationFrame(this.reqRef); 41 cancelAnimationFrame(this.reqRef);
42 clearTimeout(this.timeoutId); 42 clearTimeout(this.timeoutId);
@@ -61,7 +61,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -61,7 +61,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
61 }); 61 });
62 62
63 dispatch({ 63 dispatch({
64 - type: 'BLOCK_NAME/fetchSalesData', 64 + type: 'BLOCK_NAME_CAMEL_CASE/fetchSalesData',
65 }); 65 });
66 }; 66 };
67 67
@@ -72,7 +72,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -72,7 +72,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
72 }); 72 });
73 73
74 dispatch({ 74 dispatch({
75 - type: 'BLOCK_NAME/fetchSalesData', 75 + type: 'BLOCK_NAME_CAMEL_CASE/fetchSalesData',
76 }); 76 });
77 }; 77 };
78 78
@@ -93,7 +93,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -93,7 +93,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
93 93
94 render() { 94 render() {
95 const { rangePickerValue, salesType, currentTabKey } = this.state; 95 const { rangePickerValue, salesType, currentTabKey } = this.state;
96 - const { BLOCK_NAME, loading } = this.props; 96 + const { BLOCK_NAME_CAMEL_CASE, loading } = this.props;
97 const { 97 const {
98 visitData, 98 visitData,
99 visitData2, 99 visitData2,
@@ -104,7 +104,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component { @@ -104,7 +104,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
104 salesTypeData, 104 salesTypeData,
105 salesTypeDataOnline, 105 salesTypeDataOnline,
106 salesTypeDataOffline, 106 salesTypeDataOffline,
107 - } = BLOCK_NAME; 107 + } = BLOCK_NAME_CAMEL_CASE;
108 let salesPieData; 108 let salesPieData;
109 if (salesType === 'all') { 109 if (salesType === 'all') {
110 salesPieData = salesTypeData; 110 salesPieData = salesTypeData;
1 import { fakeChartData } from './service'; 1 import { fakeChartData } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 visitData: [], 7 visitData: [],
@@ -22,7 +22,7 @@ const { RangePicker } = DatePicker; @@ -22,7 +22,7 @@ const { RangePicker } = DatePicker;
22 const { TextArea } = Input; 22 const { TextArea } = Input;
23 23
24 @connect(({ loading }) => ({ 24 @connect(({ loading }) => ({
25 - submitting: loading.effects['BLOCK_NAME/submitRegularForm'], 25 + submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitRegularForm'],
26 })) 26 }))
27 @Form.create() 27 @Form.create()
28 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 28 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
@@ -32,7 +32,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -32,7 +32,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
32 form.validateFieldsAndScroll((err, values) => { 32 form.validateFieldsAndScroll((err, values) => {
33 if (!err) { 33 if (!err) {
34 dispatch({ 34 dispatch({
35 - type: 'BLOCK_NAME/submitRegularForm', 35 + type: 'BLOCK_NAME_CAMEL_CASE/submitRegularForm',
36 payload: values, 36 payload: values,
37 }); 37 });
38 } 38 }
@@ -2,7 +2,7 @@ import { message } from 'antd'; @@ -2,7 +2,7 @@ import { message } from 'antd';
2 import { fakeSubmitForm } from './service'; 2 import { fakeSubmitForm } from './service';
3 3
4 export default { 4 export default {
5 - namespace: 'BLOCK_NAME', 5 + namespace: 'BLOCK_NAME_CAMEL_CASE',
6 6
7 state: {}, 7 state: {},
8 8
@@ -32,9 +32,9 @@ const RadioGroup = Radio.Group; @@ -32,9 +32,9 @@ const RadioGroup = Radio.Group;
32 const SelectOption = Select.Option; 32 const SelectOption = Select.Option;
33 const { Search, TextArea } = Input; 33 const { Search, TextArea } = Input;
34 34
35 -@connect(({ BLOCK_NAME, loading }) => ({  
36 - BLOCK_NAME,  
37 - loading: loading.models.BLOCK_NAME, 35 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  36 + BLOCK_NAME_CAMEL_CASE,
  37 + loading: loading.models.BLOCK_NAME_CAMEL_CASE,
38 })) 38 }))
39 @Form.create() 39 @Form.create()
40 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 40 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
@@ -48,7 +48,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -48,7 +48,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
48 componentDidMount() { 48 componentDidMount() {
49 const { dispatch } = this.props; 49 const { dispatch } = this.props;
50 dispatch({ 50 dispatch({
51 - type: 'BLOCK_NAME/fetch', 51 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
52 payload: { 52 payload: {
53 count: 5, 53 count: 5,
54 }, 54 },
@@ -97,7 +97,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -97,7 +97,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
97 done: true, 97 done: true,
98 }); 98 });
99 dispatch({ 99 dispatch({
100 - type: 'BLOCK_NAME/submit', 100 + type: 'BLOCK_NAME_CAMEL_CASE/submit',
101 payload: { id, ...fieldsValue }, 101 payload: { id, ...fieldsValue },
102 }); 102 });
103 }); 103 });
@@ -106,14 +106,14 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -106,14 +106,14 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
106 deleteItem = id => { 106 deleteItem = id => {
107 const { dispatch } = this.props; 107 const { dispatch } = this.props;
108 dispatch({ 108 dispatch({
109 - type: 'BLOCK_NAME/submit', 109 + type: 'BLOCK_NAME_CAMEL_CASE/submit',
110 payload: { id }, 110 payload: { id },
111 }); 111 });
112 }; 112 };
113 113
114 render() { 114 render() {
115 const { 115 const {
116 - BLOCK_NAME: { list }, 116 + BLOCK_NAME_CAMEL_CASE: { list },
117 loading, 117 loading,
118 } = this.props; 118 } = this.props;
119 const { 119 const {
1 import { queryFakeList, removeFakeList, addFakeList, updateFakeList } from './service'; 1 import { queryFakeList, removeFakeList, addFakeList, updateFakeList } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -41,21 +41,21 @@ const progressColumns = [ @@ -41,21 +41,21 @@ const progressColumns = [
41 }, 41 },
42 ]; 42 ];
43 43
44 -@connect(({ BLOCK_NAME, loading }) => ({  
45 - BLOCK_NAME,  
46 - loading: loading.effects['BLOCK_NAME/fetchBasic'], 44 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  45 + BLOCK_NAME_CAMEL_CASE,
  46 + loading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchBasic'],
47 })) 47 }))
48 class PAGE_NAME_UPPER_CAMEL_CASE extends Component { 48 class PAGE_NAME_UPPER_CAMEL_CASE extends Component {
49 componentDidMount() { 49 componentDidMount() {
50 const { dispatch } = this.props; 50 const { dispatch } = this.props;
51 dispatch({ 51 dispatch({
52 - type: 'BLOCK_NAME/fetchBasic', 52 + type: 'BLOCK_NAME_CAMEL_CASE/fetchBasic',
53 }); 53 });
54 } 54 }
55 55
56 render() { 56 render() {
57 - const { BLOCK_NAME, loading } = this.props;  
58 - const { basicGoods, basicProgress } = BLOCK_NAME; 57 + const { BLOCK_NAME_CAMEL_CASE, loading } = this.props;
  58 + const { basicGoods, basicProgress } = BLOCK_NAME_CAMEL_CASE;
59 let goodsData = []; 59 let goodsData = [];
60 if (basicGoods.length) { 60 if (basicGoods.length) {
61 let num = 0; 61 let num = 0;
1 import { queryBasicProfile } from './service'; 1 import { queryBasicProfile } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 basicGoods: [], 7 basicGoods: [],
@@ -7,15 +7,15 @@ import PageHeaderWrapper from './components/PageHeaderWrapper'; @@ -7,15 +7,15 @@ import PageHeaderWrapper from './components/PageHeaderWrapper';
7 7
8 import styles from './style.less'; 8 import styles from './style.less';
9 9
10 -@connect(({ BLOCK_NAME, loading }) => ({  
11 - BLOCK_NAME, 10 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  11 + BLOCK_NAME_CAMEL_CASE,
12 loading: loading.models.list, 12 loading: loading.models.list,
13 })) 13 }))
14 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 14 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
15 componentDidMount() { 15 componentDidMount() {
16 const { dispatch } = this.props; 16 const { dispatch } = this.props;
17 dispatch({ 17 dispatch({
18 - type: 'BLOCK_NAME/fetch', 18 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
19 payload: { 19 payload: {
20 count: 8, 20 count: 8,
21 }, 21 },
@@ -24,7 +24,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -24,7 +24,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
24 24
25 render() { 25 render() {
26 const { 26 const {
27 - BLOCK_NAME: { list }, 27 + BLOCK_NAME_CAMEL_CASE: { list },
28 loading, 28 loading,
29 } = this.props; 29 } = this.props;
30 30
1 import { queryFakeList } from './service'; 1 import { queryFakeList } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -13,21 +13,21 @@ const { Pie, WaterWave, Gauge, TagCloud } = Charts; @@ -13,21 +13,21 @@ const { Pie, WaterWave, Gauge, TagCloud } = Charts;
13 13
14 const targetTime = new Date().getTime() + 3900000; 14 const targetTime = new Date().getTime() + 3900000;
15 15
16 -@connect(({ BLOCK_NAME, loading }) => ({  
17 - BLOCK_NAME, 16 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  17 + BLOCK_NAME_CAMEL_CASE,
18 loading: loading.models.monitor, 18 loading: loading.models.monitor,
19 })) 19 }))
20 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { 20 class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
21 componentDidMount() { 21 componentDidMount() {
22 const { dispatch } = this.props; 22 const { dispatch } = this.props;
23 dispatch({ 23 dispatch({
24 - type: 'BLOCK_NAME/fetchTags', 24 + type: 'BLOCK_NAME_CAMEL_CASE/fetchTags',
25 }); 25 });
26 } 26 }
27 27
28 render() { 28 render() {
29 - const { BLOCK_NAME, loading } = this.props;  
30 - const { tags } = BLOCK_NAME; 29 + const { BLOCK_NAME_CAMEL_CASE, loading } = this.props;
  30 + const { tags } = BLOCK_NAME_CAMEL_CASE;
31 31
32 return ( 32 return (
33 <React.Fragment> 33 <React.Fragment>
1 import { queryTags } from './service'; 1 import { queryTags } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 tags: [], 7 tags: [],
@@ -11,9 +11,9 @@ import styles from './style.less'; @@ -11,9 +11,9 @@ import styles from './style.less';
11 const { Option } = Select; 11 const { Option } = Select;
12 const FormItem = Form.Item; 12 const FormItem = Form.Item;
13 13
14 -@connect(({ BLOCK_NAME, loading }) => ({  
15 - BLOCK_NAME,  
16 - loading: loading.models.BLOCK_NAME, 14 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  15 + BLOCK_NAME_CAMEL_CASE,
  16 + loading: loading.models.BLOCK_NAME_CAMEL_CASE,
17 })) 17 }))
18 @Form.create({ 18 @Form.create({
19 onValuesChange({ dispatch }, changedValues, allValues) { 19 onValuesChange({ dispatch }, changedValues, allValues) {
@@ -22,7 +22,7 @@ const FormItem = Form.Item; @@ -22,7 +22,7 @@ const FormItem = Form.Item;
22 console.log(changedValues, allValues); 22 console.log(changedValues, allValues);
23 // 模拟查询表单生效 23 // 模拟查询表单生效
24 dispatch({ 24 dispatch({
25 - type: 'BLOCK_NAME/fetch', 25 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
26 payload: { 26 payload: {
27 count: 8, 27 count: 8,
28 }, 28 },
@@ -33,7 +33,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -33,7 +33,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
33 componentDidMount() { 33 componentDidMount() {
34 const { dispatch } = this.props; 34 const { dispatch } = this.props;
35 dispatch({ 35 dispatch({
36 - type: 'BLOCK_NAME/fetch', 36 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
37 payload: { 37 payload: {
38 count: 8, 38 count: 8,
39 }, 39 },
@@ -42,7 +42,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent { @@ -42,7 +42,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends PureComponent {
42 42
43 render() { 43 render() {
44 const { 44 const {
45 - BLOCK_NAME: { list }, 45 + BLOCK_NAME_CAMEL_CASE: { list },
46 loading, 46 loading,
47 form, 47 form,
48 } = this.props; 48 } = this.props;
1 import { queryFakeList } from './service'; 1 import { queryFakeList } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -12,9 +12,9 @@ const FormItem = Form.Item; @@ -12,9 +12,9 @@ const FormItem = Form.Item;
12 12
13 const pageSize = 5; 13 const pageSize = 5;
14 14
15 -@connect(({ BLOCK_NAME, loading }) => ({  
16 - BLOCK_NAME,  
17 - loading: loading.models.BLOCK_NAME, 15 +@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => ({
  16 + BLOCK_NAME_CAMEL_CASE,
  17 + loading: loading.models.BLOCK_NAME_CAMEL_CASE,
18 })) 18 }))
19 @Form.create({ 19 @Form.create({
20 onValuesChange({ dispatch }, changedValues, allValues) { 20 onValuesChange({ dispatch }, changedValues, allValues) {
@@ -23,7 +23,7 @@ const pageSize = 5; @@ -23,7 +23,7 @@ const pageSize = 5;
23 console.log(changedValues, allValues); 23 console.log(changedValues, allValues);
24 // 模拟查询表单生效 24 // 模拟查询表单生效
25 dispatch({ 25 dispatch({
26 - type: 'BLOCK_NAME/fetch', 26 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
27 payload: { 27 payload: {
28 count: 5, 28 count: 5,
29 }, 29 },
@@ -34,7 +34,7 @@ class SearchList extends Component { @@ -34,7 +34,7 @@ class SearchList extends Component {
34 componentDidMount() { 34 componentDidMount() {
35 const { dispatch } = this.props; 35 const { dispatch } = this.props;
36 dispatch({ 36 dispatch({
37 - type: 'BLOCK_NAME/fetch', 37 + type: 'BLOCK_NAME_CAMEL_CASE/fetch',
38 payload: { 38 payload: {
39 count: 5, 39 count: 5,
40 }, 40 },
@@ -51,7 +51,7 @@ class SearchList extends Component { @@ -51,7 +51,7 @@ class SearchList extends Component {
51 fetchMore = () => { 51 fetchMore = () => {
52 const { dispatch } = this.props; 52 const { dispatch } = this.props;
53 dispatch({ 53 dispatch({
54 - type: 'BLOCK_NAME/appendFetch', 54 + type: 'BLOCK_NAME_CAMEL_CASE/appendFetch',
55 payload: { 55 payload: {
56 count: pageSize, 56 count: pageSize,
57 }, 57 },
@@ -61,7 +61,7 @@ class SearchList extends Component { @@ -61,7 +61,7 @@ class SearchList extends Component {
61 render() { 61 render() {
62 const { 62 const {
63 form, 63 form,
64 - BLOCK_NAME: { list }, 64 + BLOCK_NAME_CAMEL_CASE: { list },
65 loading, 65 loading,
66 } = this.props; 66 } = this.props;
67 const { getFieldDecorator } = form; 67 const { getFieldDecorator } = form;
1 import { queryFakeList } from './service'; 1 import { queryFakeList } from './service';
2 2
3 export default { 3 export default {
4 - namespace: 'BLOCK_NAME', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE',
5 5
6 state: { 6 state: {
7 list: [], 7 list: [],
@@ -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, loading }) => ({  
17 - BLOCK_NAME_CAMEL_CASE,  
18 - loading: loading.models.BLOCK_NAME_CAMEL_CASE, 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,
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/fetch', 27 + type: 'BLOCK_NAME_CAMEL_CASE_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/fetch', 38 + type: 'BLOCK_NAME_CAMEL_CASE_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: { list = [] }, 47 + BLOCK_NAME_CAMEL_CASE_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', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE_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', 5 + namespace: 'BLOCK_NAME_CAMEL_CASE_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, loading }) => ({  
276 - BLOCK_NAME_CAMEL_CASE, 275 +@connect(({ BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, loading }) => ({
  276 + BLOCK_NAME_CAMEL_CASE_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/fetch', 354 + type: 'BLOCK_NAME_CAMEL_CASE_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/fetch', 379 + type: 'BLOCK_NAME_CAMEL_CASE_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/fetch', 391 + type: 'BLOCK_NAME_CAMEL_CASE_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/remove', 411 + type: 'BLOCK_NAME_CAMEL_CASE_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/fetch', 451 + type: 'BLOCK_NAME_CAMEL_CASE_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/add', 473 + type: 'BLOCK_NAME_CAMEL_CASE_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/update', 486 + type: 'BLOCK_NAME_CAMEL_CASE_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: { data }, 619 + BLOCK_NAME_CAMEL_CASE_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', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE_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, loading }) => ({  
12 - BLOCK_NAME_CAMEL_CASE,  
13 - submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/login'], 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'],
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/getCaptcha', 33 + type: 'BLOCK_NAME_CAMEL_CASE_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/login', 47 + type: 'BLOCK_NAME_CAMEL_CASE_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, submitting } = this.props;  
68 - const { status, type: loginType } = BLOCK_NAME_CAMEL_CASE; 67 + const { BLOCK_NAME_CAMEL_CASE_CAMEL_CASE, submitting } = this.props;
  68 + const { status, type: loginType } = BLOCK_NAME_CAMEL_CASE_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', 9 + namespace: 'BLOCK_NAME_CAMEL_CASE_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, loading }) => ({  
38 - BLOCK_NAME_CAMEL_CASE,  
39 - submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submit'], 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'],
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 } = this.props; 52 + const { form, BLOCK_NAME_CAMEL_CASE_CAMEL_CASE } = this.props;
53 const account = form.getFieldValue('mail'); 53 const account = form.getFieldValue('mail');
54 - if (BLOCK_NAME_CAMEL_CASE.status === 'ok') { 54 + if (BLOCK_NAME_CAMEL_CASE_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/submit', 99 + type: 'BLOCK_NAME_CAMEL_CASE_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', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE_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: { user, project, activities, chart }, loading }) => ({ 42 +@connect(({ BLOCK_NAME_CAMEL_CASE_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/fetchUserCurrent'],  
48 - projectLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchProjectNotice'],  
49 - activitiesLoading: loading.effects['BLOCK_NAME_CAMEL_CASE/fetchActivitiesList'], 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'],
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/init', 55 + type: 'BLOCK_NAME_CAMEL_CASE_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/clear', 62 + type: 'BLOCK_NAME_CAMEL_CASE_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', 4 + namespace: 'BLOCK_NAME_CAMEL_CASE_CAMEL_CASE',
5 state: { 5 state: {
6 user: { 6 user: {
7 currentUser: {}, 7 currentUser: {},
注册登录 后发表评论