Commit 49b07d64 by 姜雷

添加无反馈信息的时候提示文字

parent aeeda94f
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
class="CustomerFeedback-List" class="CustomerFeedback-List"
v-if="show" v-if="show"
:style="`width:${width}px`" :style="`width:${width}px`"
v-loading="loading"
> >
<template v-if="feedbackList && feedbackList.length">
<div <div
class="CustomerFeedback-Item" class="CustomerFeedback-Item"
v-for="(item, index) in feedbackList" v-for="(item, index) in feedbackList"
...@@ -27,6 +29,13 @@ ...@@ -27,6 +29,13 @@
:title="item.areaName" :title="item.areaName"
>{{item.areaName}}</span> >{{item.areaName}}</span>
</div> </div>
</template>
<template v-else>
<div class="noFeedbackText">
没有需要处理的反馈
</div>
</template>
</div> </div>
</div> </div>
</template> </template>
...@@ -37,7 +46,11 @@ import { mapGetters, mapActions } from 'vuex'; ...@@ -37,7 +46,11 @@ import { mapGetters, mapActions } from 'vuex';
export default { export default {
name: 'CustomerFeedback', name: 'CustomerFeedback',
computed: { computed: {
...mapGetters('Dashboard/customerFeedback', ['feedbackList', 'count']), ...mapGetters('Dashboard/customerFeedback', [
'feedbackList',
'count',
'loading',
]),
...mapGetters(['feedbackPage']), ...mapGetters(['feedbackPage']),
}, },
data() { data() {
...@@ -100,6 +113,9 @@ export default { ...@@ -100,6 +113,9 @@ export default {
.CustomerFeedback-List { .CustomerFeedback-List {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
.noFeedbackText {
padding: 50px 20px;
}
} }
.CustomerFeedback-Item { .CustomerFeedback-Item {
display: flex; display: flex;
......
import { getFeedbackList } from '@/api/dashboard/dashboard'; import { getFeedbackList } from '@/api/dashboard/dashboard';
const FETCH_FFEDBACK_LIST = 'FETCH_FFEDBACK_LIST'; const FETCH_FFEDBACK_LIST = 'FETCH_FFEDBACK_LIST';
const FETCH_DATA = 'FETCH_DATA';
const state = () => ({ const state = () => ({
loading: false,
list: [], list: [],
count: 0, count: 0,
}); });
...@@ -9,13 +11,21 @@ const state = () => ({ ...@@ -9,13 +11,21 @@ const state = () => ({
const getters = { const getters = {
feedbackList: state => state.list, feedbackList: state => state.list,
count: state => state.count, count: state => state.count,
loading: state => state.loading,
}; };
const actions = { const actions = {
getFeedbackList({ commit }) { getFeedbackList({ commit }) {
return getFeedbackList().then(res => { commit(FETCH_DATA, true);
return getFeedbackList()
.then(res => {
const { data, count } = res; const { data, count } = res;
commit(FETCH_FFEDBACK_LIST, { list: data, count }); commit(FETCH_FFEDBACK_LIST, { list: data, count });
commit(FETCH_DATA, false);
})
.catch(err => {
console.error(err);
commit(FETCH_DATA, false);
}); });
}, },
}; };
...@@ -25,6 +35,9 @@ const mutations = { ...@@ -25,6 +35,9 @@ const mutations = {
state.list = data.list; state.list = data.list;
state.count = data.count; state.count = data.count;
}, },
[FETCH_DATA](state, fetching) {
state.loading = fetching;
},
}; };
export default { export default {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment