Skip to content

Commit

Permalink
feat: add searchData process
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed Sep 26, 2018
1 parent 12543df commit c7fdcf5
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
11 changes: 11 additions & 0 deletions mock/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ for (let i = 0; i < 7; i++) {
}

export const rankList = rank

export const searchData = {
total: {
value: 12321,
trend: 0.171
},
average: {
value: 2.7,
trend: -0.262
}
}
4 changes: 3 additions & 1 deletion src/store/modules/analysis/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export default {
visitors,
payments,
operations,
rankList
rankList,
searchData
}) {
commit(types.SET_SALES, sales)
commit(types.SET_VISITORS, visitors)
commit(types.SET_PAYMENTS, payments)
commit(types.SET_OPERATIONS, operations)
commit(types.SET_RANK_LIST, rankList)
commit(types.SET_SEARCH_DATA, searchData)
}
}
4 changes: 4 additions & 0 deletions src/store/modules/analysis/mutations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ export default {

[types.SET_RANK_LIST] (state, rankList) {
state.rankList = rankList
},

[types.SET_SEARCH_DATA] (state, searchData) {
state.searchData = searchData
}
}
3 changes: 2 additions & 1 deletion src/store/modules/analysis/mutations/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export default {
'SET_VISITORS': 'SET_VISITORS',
'SET_PAYMENTS': 'SET_PAYMENTS',
'SET_OPERATIONS': 'SET_OPERATIONS',
'SET_RANK_LIST': 'SEt_RANK_LIST'
'SET_RANK_LIST': 'SET_RANK_LIST',
'SET_SEARCH_DATA': 'SET_SEARCH_DATA'
}
15 changes: 14 additions & 1 deletion src/store/modules/analysis/state.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// store.state basic schema

export default {
sales: {
trend: [
Expand Down Expand Up @@ -46,5 +48,16 @@ export default {
name: 'sample name',
value: 10000
}
]
],

searchData: {
total: {
value: 12321,
trend: 0.1
},
average: {
value: 2.7,
trend: -0.2
}
}
}
15 changes: 13 additions & 2 deletions src/view/Analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@
</chart-card>
</el-col>
</el-row>

<analysis-tab
:chart-data="totalSalesData"
></analysis-tab>

<el-row class="analysis__search-sales" :gutter="24">
<el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
<analysis-middle></analysis-middle>
Expand All @@ -96,6 +98,7 @@
<analysis-middle></analysis-middle>
</el-col>
</el-row>

</el-main>
</template>

Expand All @@ -117,7 +120,14 @@ import {
// import { getAnalysisData } from 'SERVICES'
// ! work with dev mode
import { sales, visitors, payments, operations, rankList } from 'MOCK/analysis'
import {
sales,
visitors,
payments,
operations,
rankList,
searchData
} from 'MOCK/analysis'
export default {
data () {
Expand Down Expand Up @@ -172,7 +182,8 @@ export default {
visitors,
payments,
operations,
rankList
rankList,
searchData
})
},
Expand Down

0 comments on commit c7fdcf5

Please sign in to comment.