Commit d7cda97d by end

修复bug

parent 4447bc4e
File deleted
......@@ -58,7 +58,7 @@ class homePage extends Component {
dllXtitle: ["今日", "昨日"],
lllTime: 3, //1年 2月 3日 4周
hdlTime: 1, //1年 2月 3日 4周
hdlType: 11, //11点赞 12收藏 13评论 15分享
hdlType: 15, //11点赞 12收藏 13评论 15阅读
hdlOrg: "",
phbType: 2, //1支部 2用户
phbTime: 1, //1年 2月 3日 4周
......@@ -511,7 +511,7 @@ class homePage extends Component {
parseFloat(zlrData.qualifidNum).toFixed(2) * 100,
],
tooltip: {
formatter: function(params) {
formatter: function (params) {
// 使用 formatter 来显示百分比
return `${params.marker}${params.name}${parseFloat(
params.value
......@@ -526,7 +526,7 @@ class homePage extends Component {
label: {
show: true, //开启显示
position: "top",
formatter: function(params) {
formatter: function (params) {
// 使用 formatter 来显示百分比
return `${params.value}%`;
},
......@@ -1061,18 +1061,19 @@ class homePage extends Component {
this.hdlChange(2, e);
}}
>
<Option value={11} key={1}>
<Option value={15} key={1}>
阅读
</Option>
<Option value={11} key={2}>
点赞
</Option>
<Option value={12} key={2}>
<Option value={12} key={3}>
收藏
</Option>
<Option value={13} key={3}>
<Option value={13} key={4}>
评论
</Option>
<Option value={15} key={4}>
分享
</Option>
</Select>
<Select
className={styles.Select}
......
......@@ -19,6 +19,7 @@ import Editor from "@/common/Editor/editor";
import UpLoad from "@/common/UpLoad";
import moment from "moment";
import validator from "@/common/validatorForm/index";
import UploadImageCover from "@/common/UploadImageCover";
const FormItem = Form.Item;
class addEdit extends React.Component {
......@@ -28,17 +29,24 @@ class addEdit extends React.Component {
uploadParams: {},
uploadAction: "",
editor: "",
logourl: "",
tags: [],
fileList: [],
responseList: [],
};
this.props.gupfetch();
this.beforeUpload = this.beforeUpload.bind(this);
this.getImgUrl = this.getImgUrl.bind(this);
this.handleUploadChange = this.handleUploadChange.bind(this);
}
componentDidMount() {
const { seeEdit, type } = this.props;
if (seeEdit.logoPath) {
this.setState({
logourl: seeEdit.logoPath,
});
}
}
//多媒体组件事件
getEditorHtml = editor => {
......@@ -81,6 +89,13 @@ class addEdit extends React.Component {
});
}
}
componentWillReceiveProps(nextProps) {
if (nextProps.logo != this.props.logo) {
this.setState({
logourl: nextProps.defaultValue.image,
});
}
}
//123
handleUploadChange({ file, fileList }) {
// console.log(123,file.name.split('.')[1])
......@@ -147,7 +162,21 @@ class addEdit extends React.Component {
}
return e && this.state.fileLists;
};
getImgUrl(imageUrl) {
let _this = this;
this.setState(
{
logourl: imageUrl,
},
() => {
_this.props.form.setFields({
logoPath: {
value: imageUrl,
},
});
}
);
}
render() {
var fileUrl = "";
var fileName = "";
......@@ -247,21 +276,63 @@ class addEdit extends React.Component {
}
>
<Form>
<FormItem
{...formItemLayout}
label={"封面logo"}
extra={
<div style={{ marginLeft: "164px" }}>
请上传资源附件(支持格式jpeg、jpg、png,大小20m以内)建议尺寸:1125*900
</div>
}
>
{getFieldDecorator("logoPath", {
rules: [
{
required: true,
message: (
<span style={{ marginLeft: "164px" }}>
新闻必须上传logo
</span>
),
},
],
initialValue: this.state.logourl,
// seeEdit
// ? [
// {
// uid: 1,
// status: "done",
// reponse: "Server Error 500",
// url: seeEdit.logoPath,
// },
// ]
// : [],
})(
<div style={{ marginLeft: "2.5rem" }}>
<UploadImageCover
details={this.state.logourl}
getImgUrl={this.getImgUrl}
preRatio={["5/4"]}
maxSize={20 * 1024 * 1024}
extra="图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg" //task-1110-cwj 删除500k
/>
</div>
)}
</FormItem>
<FormItem {...formItemLayout} label="标题">
{getFieldDecorator("fileName", {
initialValue: seeEdit && seeEdit.fileName,
})(<Input disabled={type != "edit" ? true : false} />)}
</FormItem>
<FormItem {...formItemLayout} label="正文">
{/* <Editor
key={this.props.keyValue}
cbReceiver={this.getEditorHtml}
importContent={seeEdit.content}
disabled={type != "edit" ? true : false}
/> */}
{getFieldDecorator("content", {
initialValue: seeEdit && seeEdit.content,
})(<Input style={{"minHeight":'40px'}} disabled={type != "edit" ? true : false} />)}
})(
<Input
style={{ minHeight: "40px" }}
disabled={type != "edit" ? true : false}
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="图片">
......@@ -271,22 +342,6 @@ class addEdit extends React.Component {
<img key={index} src={item} alt="" style={{ width: "300px" }} />
))}
</FormItem>
{/* <FormItem {...formItemLayout} label="上传文件">
<Upload
headers={{ "X-Requested-With": null }}
fileList={this.state.fileList}
action={this.state.uploadAction}
data={this.state.uploadParams}
beforeUpload={this.beforeUpload}
onChange={this.handleUploadChange}
disabled={type != "edit" ? true : false}
>
<Button>
<Icon type="upload" /> 上传pdf附件
</Button>
</Upload>
<p>大小50mb以内</p>
</FormItem> */}
<FormItem {...formItemLayout} label="作者">
{getFieldDecorator("author", {
initialValue: seeEdit && seeEdit.author,
......
......@@ -294,6 +294,7 @@ class Atricle extends React.Component {
}
const jsonEdit = {
id,
logoPath:values.logoPath,
fileName: values.fileName.trim(),
content: values.content,
author: values.author,
......@@ -475,15 +476,6 @@ class Atricle extends React.Component {
>
取消发布
</a>
{/* <a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "编辑" });
this.seeEdit(record.id, "edit");
}}
>
编辑
</a> */}
<a
className={Styles.marr10}
onClick={() => {
......
......@@ -9,10 +9,7 @@ import {
Tooltip,
Pagination,
Popconfirm,
Divider,
Row,
Col,
Button,
Divider
} from "antd";
import {
getCommentList,
......@@ -108,24 +105,20 @@ class Comment extends React.Component {
dataIndex: "commentator",
key: "commentator",
},
{
title: "姓名",
dataIndex: "commentatorName", //createByFullName
dataIndex: "commentatorName",
key: "commentatorName",
},
{
title: "评论对象",
dataIndex: "replyName", //parentAccountFullName
dataIndex: "replyName",
key: "replyName",
},
{
title: "评论内容",
dataIndex: "content",
key: "content",
// width: '0%',
render: text => {
return (
<Tooltip title={text}>
......@@ -142,7 +135,6 @@ class Comment extends React.Component {
<span>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</span>
),
},
{
title: "点赞数",
dataIndex: "thumbsUps",
......@@ -184,7 +176,6 @@ class Comment extends React.Component {
<a>上架</a>
</Popconfirm>
)}
<Divider type="vertical" />
<Popconfirm
title="确定删除该评论?"
......
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