Commit f7f43b43 by yanglang123

修改

parent 95c86962
......@@ -39,8 +39,8 @@
.row1{
display: flex;
justify-content: space-between;
.card{
width: 285px;
height: 100px;
......@@ -180,9 +180,7 @@
justify-content: center;
align-items: center;
& .Select{
width: 80px;
}
& .Select:nth-child(1){
width: 80px;
}
}
}
......@@ -226,9 +224,7 @@
align-items: center;
& .Select{
width: 80px;
}
& .Select:nth-child(1){
}
}
}
......@@ -254,9 +250,9 @@
border-right:1px dashed #c5c5d3 ;
font-family: PingFang SC, PingFang SC-400;
color: #8b8ba7;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
& > div:nth-child(2){
height: 6px;
......@@ -315,13 +311,7 @@
align-items: center;
& .Select{
width: 65px;
}
& .Select:nth-child(1){
// margin-right: 10px;
}
& .Select:nth-child(2){
// margin-right: 10px;
}
& .Select:nth-child(3){
width: 80px;
......@@ -367,7 +357,7 @@
align-items: center;
& .Select{
width: 80px;
}
& .Select:nth-child(1){
margin-right: 10px;
......@@ -437,7 +427,7 @@
}
}
}
}
}
......@@ -464,7 +454,7 @@
border-radius: 5px;
& > div:nth-child(1){
display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
margin-bottom: 18px;
&> img{
......@@ -588,7 +578,7 @@
}
}
}
}
& > .zllbox2{
margin-top: 21px;
......@@ -615,9 +605,9 @@
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
margin-bottom: 12px;
}
& > p{
......@@ -645,7 +635,7 @@
height: 30px;
line-height: 30px;
}
}
}
& > .zllNum{
......@@ -659,9 +649,9 @@
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
margin-bottom: 12px;
}
& > p{
......@@ -685,7 +675,7 @@
border-radius: 5px;
& > div:nth-child(1){
display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
margin-bottom: 18px;
&> img{
......@@ -737,7 +727,7 @@
border-radius: 5px;
& > div:nth-child(1){
display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
margin-bottom: 38px;
&> img{
......@@ -757,7 +747,7 @@
width: 190px;
background: #f3f6f9;
border-radius: 4px;
box-shadow: 0px 2.5px 5px 0px #f1f2fa;
box-shadow: 0px 2.5px 5px 0px #f1f2fa;
margin: 0 auto 38px;
padding: 26px 22px;
& > div:nth-child(1){
......@@ -797,7 +787,7 @@
border-radius: 5px;
& > div:nth-child(1){
display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
margin-bottom: 18px;
&> img{
......@@ -847,9 +837,7 @@
justify-content: center;
align-items: center;
& .Select{
width: 80px;
}
& .Select:nth-child(1){
width: 80px;
}
}
}
......@@ -898,9 +886,7 @@
justify-content: center;
align-items: center;
& .Select{
width: 80px;
}
& .Select:nth-child(1){
width: 80px;
}
}
}
......@@ -936,9 +922,9 @@
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
margin-bottom: 4px;
}
& > div{
......@@ -947,7 +933,7 @@
line-height: 26px;
display: flex;
align-items: center;
justify-content: start;
justify-content: flex-start;
padding-left: 22px;
& > span:nth-child(1){
height: 8px;
......@@ -967,7 +953,7 @@
height: 30px;
line-height: 30px;
}
}
}
& > .zllNum{
......@@ -981,9 +967,9 @@
font-size: 12px;
font-family: PingFang SC, PingFang SC-400;
text-align: center;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
margin-bottom: 4px;
}
& > p{
......
......@@ -50,7 +50,7 @@ import {
} from "./redux/action";
import moment from "moment";
import Styles from "./index.less";
import InfoComment from "./InfoComment.jsx";
const TreeNode = Tree.TreeNode;
const FormItem = Form.Item;
const Option = Select.Option;
......@@ -421,6 +421,10 @@ class Information extends React.Component {
start: "",
end: "",
},
commentKey: "", //评论管理modal key
commentName: "", //评论管理 项目名称
commentId: "", //评论管理 项目ID
commentVisible: false, //评论弹框
};
}
......@@ -622,6 +626,23 @@ class Information extends React.Component {
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 => {
let _this = this;
......@@ -1115,6 +1136,12 @@ class Information extends React.Component {
>
{record.isTop == "1" ? "移除首页" : "同步首页"}
</a>
<a
className={Styles.marr10}
onClick={() => this.showComment(record.id, record.name)}
>
评论管理
</a>
{record.state == "2" ? (
<div style={{ display: "inline" }}>
<a
......@@ -1189,7 +1216,6 @@ class Information extends React.Component {
return (
<div className={Styles.pmEditIcon}>
<Head headForm={this.headForm} showModal={this.showModal} />
<Row>
<Col
span={4}
......@@ -1304,6 +1330,20 @@ class Information extends React.Component {
</FormItem>
</Form>
</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>
);
}
......
......@@ -13,4 +13,15 @@ export default {
getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`,
postUpdataApi: `POST ${services.webManage}/site/classify/info/update`,
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 {
this.setState({ value });
};
handleExpand = (expanded, record) => {
// console.log('****&&&&&',expanded, record)
// console.log(123);
this.setState({ Rkey: record.index });
this.props.getreplylist({ commmentId: record.id }, record.index, () => {
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