Commit f7f43b43 by yanglang123

修改

parent 95c86962
...@@ -182,8 +182,6 @@ ...@@ -182,8 +182,6 @@
& .Select{ & .Select{
width: 80px; width: 80px;
} }
& .Select:nth-child(1){
}
} }
} }
} }
...@@ -228,8 +226,6 @@ ...@@ -228,8 +226,6 @@
width: 80px; width: 80px;
} }
& .Select:nth-child(1){
}
} }
} }
} }
...@@ -317,12 +313,6 @@ ...@@ -317,12 +313,6 @@
width: 65px; width: 65px;
} }
& .Select:nth-child(1){
// margin-right: 10px;
}
& .Select:nth-child(2){
// margin-right: 10px;
}
& .Select:nth-child(3){ & .Select:nth-child(3){
width: 80px; width: 80px;
} }
...@@ -464,7 +454,7 @@ ...@@ -464,7 +454,7 @@
border-radius: 5px; border-radius: 5px;
& > div:nth-child(1){ & > div:nth-child(1){
display: flex; display: flex;
justify-content: start; justify-content: flex-start;
align-items: center; align-items: center;
margin-bottom: 18px; margin-bottom: 18px;
&> img{ &> img{
...@@ -685,7 +675,7 @@ ...@@ -685,7 +675,7 @@
border-radius: 5px; border-radius: 5px;
& > div:nth-child(1){ & > div:nth-child(1){
display: flex; display: flex;
justify-content: start; justify-content: flex-start;
align-items: center; align-items: center;
margin-bottom: 18px; margin-bottom: 18px;
&> img{ &> img{
...@@ -737,7 +727,7 @@ ...@@ -737,7 +727,7 @@
border-radius: 5px; border-radius: 5px;
& > div:nth-child(1){ & > div:nth-child(1){
display: flex; display: flex;
justify-content: start; justify-content: flex-start;
align-items: center; align-items: center;
margin-bottom: 38px; margin-bottom: 38px;
&> img{ &> img{
...@@ -797,7 +787,7 @@ ...@@ -797,7 +787,7 @@
border-radius: 5px; border-radius: 5px;
& > div:nth-child(1){ & > div:nth-child(1){
display: flex; display: flex;
justify-content: start; justify-content: flex-start;
align-items: center; align-items: center;
margin-bottom: 18px; margin-bottom: 18px;
&> img{ &> img{
...@@ -849,8 +839,6 @@ ...@@ -849,8 +839,6 @@
& .Select{ & .Select{
width: 80px; width: 80px;
} }
& .Select:nth-child(1){
}
} }
} }
} }
...@@ -900,8 +888,6 @@ ...@@ -900,8 +888,6 @@
& .Select{ & .Select{
width: 80px; width: 80px;
} }
& .Select:nth-child(1){
}
} }
} }
} }
...@@ -947,7 +933,7 @@ ...@@ -947,7 +933,7 @@
line-height: 26px; line-height: 26px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: start; justify-content: flex-start;
padding-left: 22px; padding-left: 22px;
& > span:nth-child(1){ & > span:nth-child(1){
height: 8px; height: 8px;
......
...@@ -50,7 +50,7 @@ import { ...@@ -50,7 +50,7 @@ import {
} from "./redux/action"; } from "./redux/action";
import moment from "moment"; import moment from "moment";
import Styles from "./index.less"; import Styles from "./index.less";
import InfoComment from "./InfoComment.jsx";
const TreeNode = Tree.TreeNode; const TreeNode = Tree.TreeNode;
const FormItem = Form.Item; const FormItem = Form.Item;
const Option = Select.Option; const Option = Select.Option;
...@@ -421,6 +421,10 @@ class Information extends React.Component { ...@@ -421,6 +421,10 @@ class Information extends React.Component {
start: "", start: "",
end: "", end: "",
}, },
commentKey: "", //评论管理modal key
commentName: "", //评论管理 项目名称
commentId: "", //评论管理 项目ID
commentVisible: false, //评论弹框
}; };
} }
...@@ -622,6 +626,23 @@ class Information extends React.Component { ...@@ -622,6 +626,23 @@ class Information extends React.Component {
console.log(this.props.tableList, "-------------tableList----------"); console.log(this.props.tableList, "-------------tableList----------");
}); });
}; };
//弹出评论管理
showComment = (id, name) => {
this.setState(
{
commentVisible: true,
commentKey: new Date().getTime(),
commentId: id,
commentName: name,
}
);
};
//关闭评论管理
hideComment = () => {
this.setState({
commentVisible: false,
});
};
//上架 //上架
shelves = record => { shelves = record => {
let _this = this; let _this = this;
...@@ -1115,6 +1136,12 @@ class Information extends React.Component { ...@@ -1115,6 +1136,12 @@ class Information extends React.Component {
> >
{record.isTop == "1" ? "移除首页" : "同步首页"} {record.isTop == "1" ? "移除首页" : "同步首页"}
</a> </a>
<a
className={Styles.marr10}
onClick={() => this.showComment(record.id, record.name)}
>
评论管理
</a>
{record.state == "2" ? ( {record.state == "2" ? (
<div style={{ display: "inline" }}> <div style={{ display: "inline" }}>
<a <a
...@@ -1189,7 +1216,6 @@ class Information extends React.Component { ...@@ -1189,7 +1216,6 @@ class Information extends React.Component {
return ( return (
<div className={Styles.pmEditIcon}> <div className={Styles.pmEditIcon}>
<Head headForm={this.headForm} showModal={this.showModal} /> <Head headForm={this.headForm} showModal={this.showModal} />
<Row> <Row>
<Col <Col
span={4} span={4}
...@@ -1304,6 +1330,20 @@ class Information extends React.Component { ...@@ -1304,6 +1330,20 @@ class Information extends React.Component {
</FormItem> </FormItem>
</Form> </Form>
</Modal> </Modal>
{/*评论管理*/}
<Modal
width={1250}
visible={this.state.commentVisible}
onCancel={this.hideComment}
footer={false}
key={this.state.commentKey}
destroyOnClose={1}
>
<InfoComment
id={this.state.commentId}
name={this.state.commentName}
/>
</Modal>
</div> </div>
); );
} }
......
...@@ -13,4 +13,15 @@ export default { ...@@ -13,4 +13,15 @@ export default {
getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`, getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`,
postUpdataApi: `POST ${services.webManage}/site/classify/info/update`, postUpdataApi: `POST ${services.webManage}/site/classify/info/update`,
getMenuApi: `GET ${services.base}/system/dictionary/child/listByCode`, getMenuApi: `GET ${services.base}/system/dictionary/child/listByCode`,
comment: {
getCommentsList: `GET ${services.webManage}/tpComment/list`,
getRepCommentList: `GET ${services.webManage}/tpCommentReply/list`,
downloadComments: `GET ${services.webManage}/tpComment/list/export`,
upRepComment: `GET ${services.webManage}/tpCommentReply/up`,
upComment: `GET ${services.webManage}/tpComment/up`,
downRepComment: `GET ${services.webManage}/tpCommentReply/down`,
downComment: `GET ${services.webManage}/tpComment/down`,
deleteRepComment: `GET ${services.webManage}/tpCommentReply/deleteReply`,
deleteComment: `POST ${services.webManage}/tpComment/deleteTpComment`,
},
}; };
import { message } from "antd";
import request from "@/util/request.js";
import api from "./api";
import { createAction } from "redux-actions";
const { comment } = api;
const {
getCommentsList,
getRepCommentList,
downloadComments,
upComment,
upRepComment,
downRepComment,
downComment,
deleteRepComment,
deleteComment,
} = comment;
export const GET_COMMENT_LIST_TRAIN = "GET_COMMENT_LIST_TRAIN";
export const GET_REPLY_LIST_TRAIN = "GET_REPLY_LIST_TRAIN";
let getcommentlist = createAction(GET_COMMENT_LIST_TRAIN);
let getreplylist = createAction(GET_REPLY_LIST_TRAIN);
export { getcommentlist, getreplylist };
//获取评论列表
export function getCommentList(param, paramreply) {
return dispatch => {
return request({
url: getCommentsList,
data: param,
}).then(res => {
if (res.code === "1000") {
let arr = [];
for (let i = 0; i < res.data.records.length; i++) {
const temp = {
...res.data.records[i],
// key:(res.data.total-(param.pageNo-1)*param.pageSize-i)
key: i + 1,
};
if (res.data.records[i].replys > 0) {
temp.children = [];
temp.index = i;
}
arr.push(temp);
}
dispatch({
type: GET_COMMENT_LIST_TRAIN,
data: {
list: arr,
listTotal: res.data.total,
avgLevel: res.data.avgLevel,
},
});
} else {
message.error("加载失败...");
}
});
};
}
//获取回复列表
export function getReplyList(param, key, callback) {
return dispatch => {
return request({
url: getRepCommentList,
data: param,
}).then(res => {
if (res.code === "1000") {
// console.log(res.data.records)
const arr = [];
for (let i = 0; i < res.data.records.length; i++) {
arr.push({
...res.data.records[i],
commentatorName: res.data.records[i].createByFullName,
replyName: res.data.records[i].parentAccountFullName,
commentator: res.data.records[i].createByName,
flag: "reply",
});
}
dispatch({
type: GET_REPLY_LIST_TRAIN,
data: { children: arr, key: key },
});
console.log(arr);
if (callback) {
callback();
}
} else {
message.error("加载失败...");
}
});
};
}
//下载评论
export function downloadComment(param) {
return dispatch => {
return request({
url: downloadComments,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success(res.data.result);
} else {
message.error(res.subMsg);
}
});
};
}
//评论上架
export function handleUp(param, page, callback) {
let params = {};
params.id = param.id;
if (param.isreply) {
return dispatch => {
return request({
url: upRepComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已上架");
dispatch(getReplyList(param, param.index, callback));
} else {
message.error("提交失败...");
}
});
};
}
return dispatch => {
return request({
url: upComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已上架");
dispatch(getCommentList(page));
} else {
message.error("提交失败...");
}
});
};
}
//评论下架
export function checkComment(param, page, callback) {
let params = {};
params.id = param.id;
if (param.isreply) {
return dispatch => {
return request({
url: downRepComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已下架");
dispatch(getReplyList(param, param.index, callback));
} else {
message.error("提交失败...");
}
});
};
}
return dispatch => {
return request({
url: downComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已下架");
dispatch(getCommentList(page));
} else {
message.error("提交失败...");
}
});
};
}
//删除
export function tpCommentDel(param, page, callback) {
let params = {};
params.replyId = param.id;
if (param.isreply) {
return dispatch => {
return request({
url: deleteRepComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已删除");
dispatch(getReplyList(param, param.index, callback));
} else {
message.error("删除失败...");
}
});
};
}
return dispatch => {
return request({
url: deleteComment,
data: param,
}).then(res => {
if (res.code === "1000") {
message.success("已删除");
dispatch(getCommentList(page));
} else {
message.error("删除失败...");
}
});
};
}
...@@ -216,8 +216,6 @@ class Comment extends React.Component { ...@@ -216,8 +216,6 @@ class Comment extends React.Component {
this.setState({ value }); this.setState({ value });
}; };
handleExpand = (expanded, record) => { handleExpand = (expanded, record) => {
// console.log('****&&&&&',expanded, record)
// console.log(123);
this.setState({ Rkey: record.index }); this.setState({ Rkey: record.index });
this.props.getreplylist({ commmentId: record.id }, record.index, () => { this.props.getreplylist({ commmentId: record.id }, record.index, () => {
this.setState({ a: 2 }); this.setState({ a: 2 });
......
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