|
@@ -4,7 +4,7 @@ import { BirdGrid } from 'components/Grid';
|
|
|
import { connect } from "dva";
|
|
|
import 'braft-editor/dist/index.css'
|
|
|
import { config, request, util } from "utils";
|
|
|
-import { Modal, Upload, Select, Form, Input, Button, message, Icon, Checkbox, Mentions } from "antd";
|
|
|
+import { Modal, Upload, Select, Form, Input, Button, message, Icon, Checkbox, Mentions , InputNumber } from "antd";
|
|
|
import { type } from 'jquery';
|
|
|
const { WXMpAPI } = config;
|
|
|
import BraftEditor from 'braft-editor'
|
|
@@ -16,19 +16,20 @@ class ArticleManage extends React.Component {
|
|
|
level: false,
|
|
|
Selected: "",
|
|
|
Topping: false,
|
|
|
+ offsetTop: false,
|
|
|
offshelf: false,
|
|
|
httpModal: false,
|
|
|
textUrl: "",
|
|
|
offshelfId: '',
|
|
|
stickyPosts: "",
|
|
|
defaultAdd: false,
|
|
|
- articleContent:"",
|
|
|
+ articleContent: "",
|
|
|
editorState: BraftEditor.createEditorState('<p>亮剑集团!</b></p>'), // 设置编辑器初始内容
|
|
|
- outputHTML: '<p></p>',
|
|
|
+ outputHTML: '',
|
|
|
typeItem: [
|
|
|
- { label: "全局置顶",value:"3", typographicTypeId: "3", disabled: false },
|
|
|
- { label: "科室置顶",value:"2",typographicTypeId: "2", disabled: false },
|
|
|
- { label: "分类置顶",value:"1",typographicTypeId: "1", disabled: false },
|
|
|
+ { label: "全局置顶", value: "3", typographicTypeId: "3", disabled: false },
|
|
|
+ { label: "科室置顶", value: "2", typographicTypeId: "2", disabled: false },
|
|
|
+ { label: "分类置顶", value: "1", typographicTypeId: "1", disabled: false },
|
|
|
], // 置顶类型
|
|
|
checkStateDataBase: [
|
|
|
{ label: "未通过", value: "0", disabled: false },
|
|
@@ -64,7 +65,8 @@ class ArticleManage extends React.Component {
|
|
|
articleId: "", // 文章ID
|
|
|
defaultName: "", // 栏目
|
|
|
articleTitle: "", // 标题
|
|
|
- articleEditorId: "",// 作者
|
|
|
+ articleEditor: "",// 作者
|
|
|
+ articleEditorId: "",// 作者ID
|
|
|
articleCardinalnumber: "", // 基数
|
|
|
typographicTypeList: [], // 置顶设置
|
|
|
articleSummary: "", // 摘要
|
|
@@ -79,14 +81,14 @@ class ArticleManage extends React.Component {
|
|
|
componentDidMount() {
|
|
|
this.isLivinig = true
|
|
|
// 3秒后更改编辑器内容
|
|
|
- setTimeout(this.setEditorContentAsync,500)
|
|
|
+ setTimeout(this.setEditorContentAsync, 500)
|
|
|
// 获取栏目选择数据
|
|
|
request({
|
|
|
- url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
|
|
|
+ url: config.WXMpAPI + "/wx/content/column/queryAllidColumns",
|
|
|
method: "post",
|
|
|
- data:{
|
|
|
- pageIndex:1,
|
|
|
- pageSize:50
|
|
|
+ data: {
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 50
|
|
|
}
|
|
|
}).then((data) => {
|
|
|
this.setState({
|
|
@@ -101,15 +103,34 @@ class ArticleManage extends React.Component {
|
|
|
this.isLivinig = false
|
|
|
// setTimeout(this.setEditorContentAsync, 200)
|
|
|
}
|
|
|
- onChangeGrid = ( key) =>{
|
|
|
- const _Id = key[0]
|
|
|
- if(_Id.field == "article_column_id"){
|
|
|
- this.getContentUpdate( _Id.value );
|
|
|
- }
|
|
|
+ updateArticleStatus = status =>{
|
|
|
+
|
|
|
+
|
|
|
+ return status
|
|
|
+ }
|
|
|
+ handleUpdate = (value, type) => {
|
|
|
+ // console.log(value,type);
|
|
|
+ if (type) {
|
|
|
+ this.setState({
|
|
|
+ offshelf: true,
|
|
|
+ offshelfId: value,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setState({
|
|
|
+ offsetTop: true,
|
|
|
+ offshelfId: value,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- updateChange = (e)=>{
|
|
|
+ onChangeGrid = (key) => {
|
|
|
+ const _Id = key[0]
|
|
|
+ if (_Id.field == "article_column_id") {
|
|
|
+ this.getContentUpdate(_Id.value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updateChange = (e) => {
|
|
|
this.setState({
|
|
|
- articleTitle:e.target.value
|
|
|
+ articleTitle: e.target.value
|
|
|
}, () => {
|
|
|
|
|
|
})
|
|
@@ -150,12 +171,24 @@ class ArticleManage extends React.Component {
|
|
|
removeImg = (imgSrc) => {
|
|
|
|
|
|
}
|
|
|
- handleChange = (handle) => {
|
|
|
+ handleChange = (handle, index) => {
|
|
|
+ console.log(handle, 'index');
|
|
|
this.setState({
|
|
|
handImgPath: handle.fileList[0] && handle.fileList[0].response ? handle.fileList[0].response.path : "",
|
|
|
headImgList: handle.fileList
|
|
|
})
|
|
|
}
|
|
|
+ updeImg(imgUrl) {
|
|
|
+ let result = [];
|
|
|
+ if (imgUrl) {
|
|
|
+ result.push({
|
|
|
+ uid: '-1',
|
|
|
+ status: "done",
|
|
|
+ url: imgUrl,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
// 查询详情
|
|
|
editMation = (id) => {
|
|
|
request({
|
|
@@ -165,28 +198,39 @@ class ArticleManage extends React.Component {
|
|
|
const returned = data.result
|
|
|
const { typeItem } = this.state
|
|
|
if (returned.articlePhotoaddress) {
|
|
|
- var imgUrlMini = returned.articlePhotoaddress;
|
|
|
- console.log(imgUrlMini,'默认的');
|
|
|
- if (imgUrlMini) {
|
|
|
- let SsoToken = util.auth.getToken();
|
|
|
- let imgSeperator = "?";
|
|
|
- if (imgUrlMini.indexOf("?") !== -1) imgSeperator = "&";
|
|
|
- if (imgUrlMini.indexOf("&") !== -1) imgSeperator = "&";
|
|
|
- imgUrlMini = imgUrlMini.indexOf('Sso-Token') > -1 ? imgUrlMini : imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken;
|
|
|
- console.log(imgUrlMini,'no默认的');
|
|
|
- }
|
|
|
- let list = []
|
|
|
- let obj = {}
|
|
|
- obj.url = imgUrlMini
|
|
|
- obj.status = "done",
|
|
|
- obj.uid = '-2'
|
|
|
- list.push(obj)
|
|
|
+ // const imgUrlMini = returned.articlePhotoaddress;
|
|
|
+ // if (imgUrlMini) {
|
|
|
+ // let SsoToken = util.auth.getToken();
|
|
|
+ // let imgSeperator = "?";
|
|
|
+ // if (imgUrlMini.indexOf("?") !== -1) imgSeperator = "&";
|
|
|
+ // if (imgUrlMini.indexOf("&") !== -1) imgSeperator = "&";
|
|
|
+ // imgUrlMini = imgUrlMini.indexOf('Sso-Token') > -1 ? imgUrlMini : imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken;
|
|
|
+ // console.log(imgUrlMini,'no默认的');
|
|
|
+ // }
|
|
|
+
|
|
|
+ // const url = this.updeImg(imgUrlMini)
|
|
|
+ // this.setState({
|
|
|
+ // headImgList:url,
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // this.setState({
|
|
|
+ // headImgList:[],
|
|
|
+ // })
|
|
|
+ }
|
|
|
+
|
|
|
+ const imgUrlMini = returned.articlePhotoaddress;
|
|
|
+ var imgObj = [{
|
|
|
+ uid: '-1',
|
|
|
+ url: imgUrlMini,
|
|
|
+ }]
|
|
|
+ console.log(imgObj);
|
|
|
+ if (imgUrlMini) {
|
|
|
this.setState({
|
|
|
- headImgList: list,
|
|
|
+ headImgList: imgObj,
|
|
|
})
|
|
|
} else {
|
|
|
this.setState({
|
|
|
- headImgList:[],
|
|
|
+ headImgList: [],
|
|
|
})
|
|
|
}
|
|
|
var typographicTypeList = []
|
|
@@ -198,11 +242,12 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(returned,'returned');
|
|
|
+ console.log(returned, 'returned');
|
|
|
this.setState({
|
|
|
- defaultName:returned.column ? returned.column.columnName : "", // 栏目
|
|
|
- tagId:returned.column ? returned.column.columnId : "", // 栏目
|
|
|
+ defaultName: returned.column ? returned.column.columnName : "", // 栏目
|
|
|
+ tagId: returned.column ? returned.column.columnId : "", // 栏目
|
|
|
articleTitle: returned.articleTitle, // 标题
|
|
|
+ articleEditor: returned.articleAuthor ? returned.articleAuthor : "正在生成",// 作者
|
|
|
articleEditorId: returned.articleAuthorId,// 作者
|
|
|
articleCardinalnumber: returned.articleCardinalnumber, // 基数
|
|
|
articleSummary: returned.articleSummary, // 摘要
|
|
@@ -213,7 +258,7 @@ class ArticleManage extends React.Component {
|
|
|
typographicTypeList: typographicTypeList, // 置顶设置
|
|
|
visible: true,
|
|
|
}, () => {
|
|
|
- console.log(this.state.defaultName,'defaultName');
|
|
|
+ console.log(this.state.defaultName, 'defaultName');
|
|
|
})
|
|
|
}).catch((error) => {
|
|
|
|
|
@@ -320,11 +365,13 @@ class ArticleManage extends React.Component {
|
|
|
data.articleStatus = '-1'
|
|
|
this.props.dispatch({ type: 'ContentManage/goodsTheShelf', payload: { data } });
|
|
|
setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
- } else {
|
|
|
- const value = this.refs.myInput;
|
|
|
- this.setState({
|
|
|
-
|
|
|
- })
|
|
|
+ }
|
|
|
+ if (type == "top") {
|
|
|
+ let data = {}
|
|
|
+ data.articleId = this.state.offshelfId.articleId
|
|
|
+ data.articleStatus = '1'
|
|
|
+ this.props.dispatch({ type: 'ContentManage/goodsTheShelf', payload: { data } });
|
|
|
+ setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -367,7 +414,7 @@ class ArticleManage extends React.Component {
|
|
|
handleChangeColumn = (val) => {
|
|
|
for (let i = 0; i < this.state.queryAllColumns.length; i++) {
|
|
|
if (this.state.queryAllColumns[i].columnName == val) {
|
|
|
- console.log(this.state.queryAllColumns[i].columnId,'uk-icon-ioxhost');
|
|
|
+ console.log(this.state.queryAllColumns[i].columnId, 'uk-icon-ioxhost');
|
|
|
this.setState({
|
|
|
tagId: this.state.queryAllColumns[i].columnId,
|
|
|
});
|
|
@@ -391,14 +438,14 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ console.log(this.state.outputHTML)
|
|
|
let hicColumn = {} // 栏目ID
|
|
|
hicColumn.columnId = this.state.tagId
|
|
|
let hicDepa = this.state.selectDepartment // 科室ID
|
|
|
let hicTag = this.state.selectLableKeys // 标签ID
|
|
|
parame.articleTitle = values.title;
|
|
|
parame.articleId = this.state.articleId,
|
|
|
- parame.articleStatus = index; // 文章状态(0为保存,1为保存并发布,-1下架)
|
|
|
+ parame.articleStatus = index; // 文章状态(0为保存,1为保存并发布,-1下架)
|
|
|
// parame.articleAuthorId = 4; // 作者ID
|
|
|
parame.articleSummary = values.content
|
|
|
parame.articlePhotoaddress = this.state.handImgPath
|
|
@@ -422,6 +469,7 @@ class ArticleManage extends React.Component {
|
|
|
url: {
|
|
|
read: WXMpAPI + '/wx/content/classification/queryAllClassifications',
|
|
|
},
|
|
|
+ primaryKey: "classification_column_id",
|
|
|
filterRules: [
|
|
|
{
|
|
|
// field: "column_id",
|
|
@@ -430,13 +478,21 @@ class ArticleManage extends React.Component {
|
|
|
value: that.state.tagId
|
|
|
}
|
|
|
],
|
|
|
-
|
|
|
+ customRules: [
|
|
|
+ {
|
|
|
+ field: "classification_column_id",
|
|
|
+ operate: "equal",
|
|
|
+ value: that.state.tagId
|
|
|
+ }
|
|
|
+ ],
|
|
|
pageSize: 10,
|
|
|
checkable: true,
|
|
|
+
|
|
|
actions: [{
|
|
|
name: "分类保存",
|
|
|
onClick: (id, data) => {
|
|
|
- if(data.length==0){
|
|
|
+ console.log(data);
|
|
|
+ if (data.length == 0) {
|
|
|
message.error("请勾选分类");
|
|
|
} else {
|
|
|
message.success("保存成功");
|
|
@@ -455,6 +511,7 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
+ // classificationId
|
|
|
{ title: "分类ID", data: "classificationId", type: "text", query: false },
|
|
|
// { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
|
|
|
{ title: "分类名称", data: "classificationName", type: "text", query: false },
|
|
@@ -476,7 +533,7 @@ class ArticleManage extends React.Component {
|
|
|
actions: [{
|
|
|
name: "科室保存",
|
|
|
onClick: (id, data) => {
|
|
|
- if(data.length==0){
|
|
|
+ if (data.length == 0) {
|
|
|
message.error("请勾选科室");
|
|
|
} else {
|
|
|
message.success("保存成功");
|
|
@@ -515,7 +572,7 @@ class ArticleManage extends React.Component {
|
|
|
actions: [{
|
|
|
name: "标签保存",
|
|
|
onClick: (id, preservation) => {
|
|
|
- if(preservation.length==0){
|
|
|
+ if (preservation.length == 0) {
|
|
|
message.error("请勾选标签");
|
|
|
} else {
|
|
|
message.success("保存成功");
|
|
@@ -546,23 +603,23 @@ class ArticleManage extends React.Component {
|
|
|
};
|
|
|
return gridOption
|
|
|
}
|
|
|
- getContentUpdate =( id )=>{
|
|
|
+ getContentUpdate = (id) => {
|
|
|
let parme = {
|
|
|
"filters": [
|
|
|
{
|
|
|
"field": "column_id",
|
|
|
"operate": "equal",
|
|
|
- "value":id
|
|
|
+ "value": id
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
- request({
|
|
|
+ request({
|
|
|
url: config.WXMpAPI + "/wx/content/classification/queryAllClassificationsSelection",
|
|
|
method: "post",
|
|
|
- data:parme
|
|
|
+ data: parme
|
|
|
}).then((data) => {
|
|
|
- this.refs.grid.props.gridOption.columns[3].source.data = data
|
|
|
- this.refs.grid.state.columns[3].source.data = data
|
|
|
+ this.refs.grid.props.gridOption.columns[3].source.data = data
|
|
|
+ this.refs.grid.state.columns[3].source.data = data
|
|
|
}).catch((error) => {
|
|
|
|
|
|
});
|
|
@@ -579,7 +636,7 @@ class ArticleManage extends React.Component {
|
|
|
getColumnInformation = () => {
|
|
|
let that = this;
|
|
|
var baseDate = []
|
|
|
-
|
|
|
+
|
|
|
let gridOption = {
|
|
|
title: "权限资源",
|
|
|
title: "关键词",
|
|
@@ -595,6 +652,7 @@ class ArticleManage extends React.Component {
|
|
|
defaultName: "",
|
|
|
articleTitle: "",
|
|
|
articleEditorId: "",
|
|
|
+ articleEditor: "",
|
|
|
articleCardinalnumber: "",
|
|
|
typographicTypeList: "",
|
|
|
articleSummary: "",
|
|
@@ -607,7 +665,11 @@ class ArticleManage extends React.Component {
|
|
|
selectDepartment: [],
|
|
|
selectCategory: [],
|
|
|
articleId: "",
|
|
|
- outputHTML:""
|
|
|
+ outputHTML: ""
|
|
|
+ })
|
|
|
+
|
|
|
+ that.isLivinig && that.setState({
|
|
|
+ editorState: BraftEditor.createEditorState("<p></p>")
|
|
|
})
|
|
|
that.props.form.resetFields();
|
|
|
that.showModal('visible')
|
|
@@ -615,7 +677,7 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
],
|
|
|
columns: [
|
|
|
- { title: "文章ID", data: "articleId", type: "text", query:false },
|
|
|
+ { title: "文章ID", data: "articleId", type: "text", query: false },
|
|
|
{
|
|
|
title: "栏目名称", data: "article_column_id", type: "dropdown",
|
|
|
source: { url: WXMpAPI + "/wx/content/column/queryAllColumnsSelection" }, query: true, hide: true,
|
|
@@ -639,8 +701,6 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
{ title: "标题", data: "article_title", type: "text", query: true, hide: true },
|
|
|
|
|
|
-
|
|
|
-
|
|
|
{ title: "标题", data: "articleTitle", type: "text", query: false },
|
|
|
{ title: "作者", data: "articleAuthorId", type: "text", query: false },
|
|
|
{ title: "创建时间", data: "articleCreateDate", type: "text", query: false },
|
|
@@ -648,10 +708,19 @@ class ArticleManage extends React.Component {
|
|
|
{
|
|
|
title: "状态", data: "articleStatus", type: "number", query: false,
|
|
|
// -1 下架, 0 保存 , 1 保存发布
|
|
|
- render: state =>
|
|
|
- state == "-1" ?
|
|
|
- <div>下架</div> : state == 0 ?
|
|
|
- <div>保存</div> : state == 1 ? <div>保存发布</div> : ""
|
|
|
+ // render: state =>
|
|
|
+ // state == "-1" ?
|
|
|
+ // <div>下架</div> : state == 0 ?
|
|
|
+ // <div>保存</div> : state == 1 ? <div>保存发布</div> : ""
|
|
|
+
|
|
|
+ render: (state, record) => (
|
|
|
+ <span>
|
|
|
+ {/* <a onClick={e => this.handleUpdate(record, false)} style={{ display: state == -1 ? "black" : "none" }}> (未发布)上架 </a>
|
|
|
+ <a onClick={e => this.handleUpdate(record, true)} style={{ display: state == 1 ? "black" : "none" }}> (已发布)下架 </a> */}
|
|
|
+
|
|
|
+ { state == '-1' ? <a onClick={e => this.handleUpdate(record, false)}> (未发布)上架 </a>: <a onClick={e => this.handleUpdate(record, true)}> (已发布)下架 </a> }
|
|
|
+ </span>
|
|
|
+ ),
|
|
|
},
|
|
|
{
|
|
|
title: "操作选项", type: "command", actions: [
|
|
@@ -659,12 +728,11 @@ class ArticleManage extends React.Component {
|
|
|
name: '编辑', onClick: function (data) {
|
|
|
that.setState({
|
|
|
dynamicTitle: "编辑文章",
|
|
|
- articleId:data.articleId,
|
|
|
+ articleId: data.articleId,
|
|
|
})
|
|
|
that.props.form.resetFields();
|
|
|
- console.log(data);
|
|
|
that.editMation(data.articleId);
|
|
|
- setTimeout(that.setEditorContentAsync,1000)
|
|
|
+ setTimeout(that.setEditorContentAsync, 1000)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -688,14 +756,14 @@ class ArticleManage extends React.Component {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- name: '下架', onClick: function (data) {
|
|
|
- that.setState({
|
|
|
- offshelf: true,
|
|
|
- offshelfId: data,
|
|
|
- })
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '下架', onClick: function (data) {
|
|
|
+ // that.setState({
|
|
|
+ // offshelf: true,
|
|
|
+ // offshelfId: data,
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // },
|
|
|
{
|
|
|
name: '链接', onClick: function (data) {
|
|
|
if (data.articleLinkAddress) {
|
|
@@ -711,7 +779,7 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
],
|
|
|
};
|
|
|
return gridOption
|
|
@@ -742,32 +810,14 @@ class ArticleManage extends React.Component {
|
|
|
fileList: this.state.headImgList,
|
|
|
showUploadList: true,
|
|
|
onChange: result => this.handleChange(result),
|
|
|
- onPreview:result => this.onPreview(result),
|
|
|
- onRemove:result => this.removeImg(result),
|
|
|
- headers:{
|
|
|
+ onPreview: result => this.onPreview(result),
|
|
|
+ onRemove: result => this.removeImg(result),
|
|
|
+ headers: {
|
|
|
'Sso-Token': SsoToken
|
|
|
},
|
|
|
};
|
|
|
return (
|
|
|
<div className="ArticleManage">
|
|
|
- {/* <Modal
|
|
|
- title="选择标签"
|
|
|
- visible={this.state.level}
|
|
|
- onOk={(e) => this.handleOk('level')}
|
|
|
- onCancel={(e) => this.handleCancel('level')}
|
|
|
- width={800}
|
|
|
- >
|
|
|
- <div style={{display:this.state.Selected === 'show'? "block":"none"}}>
|
|
|
- <BirdGrid gridOption={this.selectLable()} />
|
|
|
- </div>
|
|
|
- <div style={{display:this.state.Selected === 'Department'? "block":"none"}}>
|
|
|
- <BirdGrid gridOption={this.selectDepartment()} />
|
|
|
- </div>
|
|
|
- <div style={{display:this.state.Selected === 'category'? "block":"none"}}>
|
|
|
- <BirdGrid gridOption={this.selectCategoryt()} />
|
|
|
- </div>
|
|
|
- </Modal> */}
|
|
|
-
|
|
|
<Modal
|
|
|
title="文章置顶"
|
|
|
visible={this.state.Topping}
|
|
@@ -793,6 +843,17 @@ class ArticleManage extends React.Component {
|
|
|
>
|
|
|
<div>下架文章后,用户将无法查看。是否确认下架?</div>
|
|
|
</Modal>
|
|
|
+
|
|
|
+ <Modal
|
|
|
+ title="文章上架"
|
|
|
+ visible={this.state.offsetTop}
|
|
|
+ onOk={(e) => this.offshelfClick('top')}
|
|
|
+ onCancel={(e) => this.setState({ offsetTop: false })}
|
|
|
+ width={400}
|
|
|
+ >
|
|
|
+ <div>是否确认上架?</div>
|
|
|
+ </Modal>
|
|
|
+
|
|
|
<Modal
|
|
|
title="链接"
|
|
|
visible={this.state.httpModal}
|
|
@@ -809,7 +870,7 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("show")}
|
|
|
onCancel={(e) => this.close("show")}
|
|
|
width={1200}
|
|
|
- footer = {
|
|
|
+ footer={
|
|
|
[]
|
|
|
}
|
|
|
>
|
|
@@ -822,7 +883,7 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("Department")}
|
|
|
onCancel={(e) => this.close("Department")}
|
|
|
width={1200}
|
|
|
- footer = {
|
|
|
+ footer={
|
|
|
[]
|
|
|
}
|
|
|
>
|
|
@@ -835,7 +896,7 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("category")}
|
|
|
onCancel={(e) => this.close("category")}
|
|
|
width={1200}
|
|
|
- footer = {
|
|
|
+ footer={
|
|
|
[]
|
|
|
}
|
|
|
>
|
|
@@ -862,7 +923,7 @@ class ArticleManage extends React.Component {
|
|
|
<Select onChange={(val) => this.handleChangeColumn(val)}>
|
|
|
{
|
|
|
this.state.queryAllColumns && this.state.queryAllColumns.map((item, key) => {
|
|
|
- return <Option key= { this.state.defaultName } value={item.columnName}>{item.columnName}</Option>
|
|
|
+ return <Option key={this.state.defaultName} value={item.columnName}>{item.columnName}</Option>
|
|
|
})
|
|
|
}
|
|
|
</Select>
|
|
@@ -874,7 +935,7 @@ class ArticleManage extends React.Component {
|
|
|
initialValue: this.state.articleTitle || "",
|
|
|
rules: [{ required: true, message: '请填写标题!' }],
|
|
|
})(
|
|
|
- <Input/>
|
|
|
+ <Input />
|
|
|
// <Input onChange={(e)=>this.updateChange(e)}/>
|
|
|
)}
|
|
|
</Form.Item>
|
|
@@ -886,18 +947,18 @@ class ArticleManage extends React.Component {
|
|
|
</Form.Item>
|
|
|
<Form.Item label="作者">
|
|
|
{getFieldDecorator('author', {
|
|
|
- initialValue: this.state.articleEditorId || "",
|
|
|
+ initialValue: this.state.articleEditor || "",
|
|
|
rules: [{ required: true, message: '请填写作者!' }],
|
|
|
})(
|
|
|
- <Input key={ this.state.articleEditorId }/>
|
|
|
+ <Input key={this.state.articleEditor} />
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
<Form.Item label="虚假阅读量基数">
|
|
|
{getFieldDecorator('read', {
|
|
|
- initialValue: this.state.articleCardinalnumber || "",
|
|
|
+ initialValue: this.state.articleCardinalnumber,
|
|
|
rules: [{ required: true, pattern: new RegExp(/^-?\d*(\.\d*)?$/, "g"), message: '请输入正确基数类型' }],
|
|
|
})(
|
|
|
- <Input key={ this.state.articleCardinalnumber }/>
|
|
|
+ <InputNumber min={0} key={this.state.articleCardinalnumber} />
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
<Form.Item label="置顶设置">
|
|
@@ -953,7 +1014,7 @@ class ArticleManage extends React.Component {
|
|
|
<Form.Item label="">
|
|
|
<div style={{ width: "600px", display: "flex" }}>
|
|
|
<Button type="primary" size={80} htmlType="submit" onClick={(e) => this.handleSubmit(e, 1)} style={{ marginLeft: "100px", marginRight: "30px", width: '120px' }}>保存并发布</Button>
|
|
|
- <Button type="Dashed" htmlType="submit" size={80} onClick={(e) => this.handleSubmit(e, 0)} style={{ width: '80px', marginLeft: "400px" }} >仅保存</Button>
|
|
|
+ <Button type="Dashed" htmlType="submit" size={80} onClick={(e) => this.handleSubmit(e, -1)} style={{ width: '80px', marginLeft: "400px" }} >仅保存</Button>
|
|
|
</div>
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
@@ -963,7 +1024,7 @@ class ArticleManage extends React.Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
- <BirdGrid handleChange={(key,value)=>this.onChangeGrid(key,value) } gridOption={ this.getColumnInformation()} ref="grid" />
|
|
|
+ <BirdGrid handleChange={(key, value) => this.onChangeGrid(key, value)} gridOption={this.getColumnInformation()} ref="grid" />
|
|
|
</div>
|
|
|
)
|
|
|
}
|