fix: bug修复

feature/comment-0615-ch
ch 2 years ago
parent 2b487aa480
commit 6d72891941

@ -127,7 +127,7 @@ const state = {
},
],
commentType: {
//  评论
// 评论
comment: 1,
// 追评
addComment: 2,
@ -156,28 +156,26 @@ const actions = {
...rootGetters['local/page'](pagingCode),
...data,
});
if (!res) {
ElMessage.error('评价列表查询失败');
if (res) {
commit(
'setList',
res?.records.map((i) => ({
...i,
scoreName: state.opts.score.find((item) => item.value === i.commentScore)?.label,
})) || []
);
commit('setTotal', res?.total || 0);
}
res;
commit(
'setList',
res?.records.map((i) => ({
...i,
scoreName: state.opts.score.find((item) => item.value == i.commentScore)?.label,
})) || []
);
commit('setTotal', res?.total || 0);
},
async updateShow({ state }, params) {
async updateShow({}, params) {
const res = await api.updateCommentShow(params);
if (!res) {
ElMessage.error('状态更新失败!');
return Promise.reject('更新失败');
return Promise.reject('状态更新失败!');
}
return Promise.resolve(res);
},
async getDetail({ state, commit }, id) {
async getDetail({ commit }, id) {
const res = await api.commentDetail({ id });
if (!res) {
ElMessage.error('获取详情失败');
@ -186,7 +184,7 @@ const actions = {
commit('setDetail', res);
return Promise.resolve(res);
},
async add({ state, commit }, data) {
async add({}, data) {
const res = await api.commentAdd(data);
if (!res) {
ElMessage.error('回复失败');

@ -31,7 +31,7 @@
<el-switch
v-if="detailData.id"
inactive-text="是否显示"
:value="!detailData.isShow"
:value="detailData.isShow"
@click="handleShowHide(detailData)"
/>
</div>
@ -135,6 +135,7 @@
const $textarea = ref(null);
const getDetail = async () => {
detailData.value = {};
const res = await store.dispatch('comment/getDetail', route.params.id);
if (res) {
detailData.value = _.cloneDeep(store.state.comment.detail);

@ -2,14 +2,14 @@
* @Author: ch
* @Date: 2022-06-15 17:29:32
* @LastEditors: ch
* @LastEditTime: 2022-06-20 16:52:35
* @LastEditTime: 2022-06-28 17:48:42
* @Description: file content
-->
<template>
<table-list
v-loading="loading"
:operation="['search']"
:code="pagingCode"
:code="_pagingCode"
:config="config"
:data="list"
:total="total"

@ -24,8 +24,8 @@ export default (configEnv) => {
// target: 'http://192.168.10.5:4500', // 高玉
// target: 'http://192.168.10.87:8090', // 罗战
// target: 'http://192.168.10.93:8090', // 周渺
target: 'http://192.168.10.106:8090', // 舒梦娇
// target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
// target: 'http://192.168.10.106:8090', // 舒梦娇
target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
// target: 'https://you-gateway.mashibing.com', // 生产环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),

Loading…
Cancel
Save