Commit fb3477d5 by end

修改bug

parent ac835e0c
No preview for this file type
......@@ -1111,7 +1111,7 @@ class Information extends React.Component {
// render: text => <span>{text ? text : 0}</span>,
// },
{
title: "收藏量",
title: "评论量",
dataIndex: "favoriteNum",
width: "80px",
key: "favoriteNum",
......
......@@ -30,10 +30,14 @@ class addEdit extends React.Component {
tags: [],
fileList: [],
responseList: [],
previewVisible: false, // 控制预览模态框的显示与隐藏
previewImage: "", // 预览图片的 URL
};
this.props.gupfetch();
this.beforeUpload = this.beforeUpload.bind(this);
this.handleUploadChange = this.handleUploadChange.bind(this);
this.handlePreview = this.handlePreview.bind(this); // 绑定预览图片的处理函数
this.handleCancel = this.handleCancel.bind(this); // 绑定关闭预览模态框的处理函数
}
componentDidMount() {
......@@ -214,6 +218,116 @@ class addEdit extends React.Component {
{seeEdit.ossUrl &&
JSON.parse(seeEdit.ossUrl).length > 0 &&
JSON.parse(seeEdit.ossUrl).map((item, index) => (
<img
key={index}
src={item}
alt=""
style={{ width: "300px", cursor: 'pointer' }}
onClick={() => this.handlePreview(item)} // 点击图片触发预览
/>
))}
</FormItem>
{/* 预览模态框 */}
<Modal
visible={previewVisible}
footer={null}
onCancel={this.handleCancel}
>
<img alt="preview" style={{ width: '100%' }} src={previewImage} />
</Modal>
<FormItem {...formItemLayout} label="内容">
{getFieldDecorator("content", {
initialValue: seeEdit && seeEdit.content,
})(
<textarea
disabled={type != "edit" ? true : false}
style={{ width: "600px", minHeight: "200px" }}
/>
)}
</FormItem>
</Form>
</Modal>
);
}
// 处理图片预览
handlePreview = (url) => {
this.setState({
previewImage: url,
previewVisible: true,
});
};
// 关闭预览模态框
handleCancel = () => this.setState({ previewVisible: false });
render() {
var fileUrl = "";
var fileName = "";
if (this.state.responseList[0]) {
var fileUrl = this.state.responseList[0].fileUrl;
var fileName = this.state.responseList[0].fileName;
}
const {
visible,
onCancel,
onCreate,
onApprove,
title,
fileList,
form,
seeEdit = {},
type,
} = this.props;
const { uploadParams, uploadAction, tags } = this.state;
const { getFieldDecorator } = form;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 },
},
};
const { id, state } = this.props.seeEdit;
return (
<Modal
visible={visible}
title={title}
okText="确定"
width={1000}
destroyOnClose
onCancel={onCancel}
footer={
<>
{state == 1 && (
<Button key="1" type="primary" onClick={() => onApprove(id, 2)}>
接收
</Button>
)}
<Button key="3" type="primary" onClick={onCancel}>
返回
</Button>
</>
}
>
<Form>
<FormItem {...formItemLayout} label="留言标题">
{getFieldDecorator("name", {
initialValue: seeEdit && seeEdit.name,
})(
<Input
disabled={type != "edit" ? true : false}
style={{ width: "300px" }}
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="留言图片">
{seeEdit.ossUrl &&
JSON.parse(seeEdit.ossUrl).length > 0 &&
JSON.parse(seeEdit.ossUrl).map((item, index) => (
<img key={index} src={item} alt="" style={{ width: "300px" }} />
))}
</FormItem>
......
......@@ -350,6 +350,15 @@ class Message extends React.Component {
},
},
{
title: "联系人",
dataIndex: "fullName",
width: "100px",
key: "fullName",
render: text => {
return <span title={text}>{text}</span>;
},
},
{
title: "用户名",
dataIndex: "createByName",
width: "100px",
......
......@@ -324,7 +324,6 @@ class Comment extends React.Component {
render() {
const { value } = this.state;
const { commentlist } = this.props;
console.log(commentlist, "**&*&*&*&*&*&*&commentlist*&*&*&*&*&*&");
return (
<div className={styles.comment}>
<div className={styles.mar40}>
......
......@@ -176,12 +176,13 @@ export function checkComment(param, page, callback) {
//删除
export function tpCommentDel(param, page, callback) {
let params = {};
params.replyId = param.id;
if (param.isreply) {
params.replyId = param.id;
return dispatch => {
return request({
url: deleteRepComment,
data: param,
data: params,
}).then(res => {
if (res.code === "1000") {
message.success("已删除");
......
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