|
@@ -37,11 +37,12 @@ class ArticleManage extends React.Component {
|
|
|
Selected: "",
|
|
|
Topping: false,
|
|
|
offshelf: false,
|
|
|
- httpModal:false,
|
|
|
- textUrl:"",
|
|
|
+ httpModal: false,
|
|
|
+ textUrl: "",
|
|
|
offshelfId: '',
|
|
|
- stickyPosts:"",
|
|
|
- defaultAdd:false,
|
|
|
+ stickyPosts: "",
|
|
|
+ defaultAdd: false,
|
|
|
+ articleContent:"",
|
|
|
editorState: BraftEditor.createEditorState('<p>亮剑集团!</b></p>'), // 设置编辑器初始内容
|
|
|
outputHTML: '<p></p>',
|
|
|
typeItem: [
|
|
@@ -80,7 +81,7 @@ class ArticleManage extends React.Component {
|
|
|
// },
|
|
|
],
|
|
|
handImgPath: "",
|
|
|
- articleId:"", // 文章ID
|
|
|
+ articleId: "", // 文章ID
|
|
|
defaultName: "", // 栏目
|
|
|
articleTitle: "", // 标题
|
|
|
articleEditorId: "",// 作者
|
|
@@ -112,20 +113,22 @@ class ArticleManage extends React.Component {
|
|
|
|
|
|
});
|
|
|
}
|
|
|
- componentWillUnmount () {
|
|
|
+ componentWillUnmount() {
|
|
|
this.isLivinig = false
|
|
|
+ // setTimeout(this.setEditorContentAsync, 200)
|
|
|
}
|
|
|
handleChangeText = (editorState) => {
|
|
|
this.setState({
|
|
|
editorState: editorState,
|
|
|
outputHTML: editorState.toHTML()
|
|
|
- },()=>{
|
|
|
+ }, () => {
|
|
|
console.log(editorState.toHTML());
|
|
|
})
|
|
|
}
|
|
|
setEditorContentAsync = () => {
|
|
|
+ console.log('执行了的Async');
|
|
|
this.isLivinig && this.setState({
|
|
|
- editorState: BraftEditor.createEditorState('<p>你好,<b>世界!</b><p>')
|
|
|
+ editorState: BraftEditor.createEditorState(this.state.articleContent)
|
|
|
})
|
|
|
}
|
|
|
// 栏目id 查询
|
|
@@ -160,7 +163,7 @@ class ArticleManage extends React.Component {
|
|
|
// 查询详情
|
|
|
editMation = (id) => {
|
|
|
request({
|
|
|
- url: config.WXMpAPI + "/wx/content/article/queryArticleByArticleId/"+id,
|
|
|
+ url: config.WXMpAPI + "/wx/content/article/queryArticleByArticleId/" + id,
|
|
|
method: "get",
|
|
|
}).then((data) => {
|
|
|
const returned = data.result
|
|
@@ -183,9 +186,7 @@ class ArticleManage extends React.Component {
|
|
|
headImgList: list,
|
|
|
})
|
|
|
}
|
|
|
- this.setState({
|
|
|
- visible:true,
|
|
|
- })
|
|
|
+
|
|
|
var typographicTypeList = []
|
|
|
var checkedList = returned.typographicTypeList
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
@@ -195,17 +196,21 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ console.log(returned,'returned');
|
|
|
this.setState({
|
|
|
- defaultName: returned.column.columnName, // 栏目
|
|
|
+ defaultName:returned.column ? returned.column.columnName : "", // 栏目
|
|
|
+ tagId:returned.column ? returned.column.columnId : "", // 栏目
|
|
|
articleTitle: returned.articleTitle, // 标题
|
|
|
articleEditorId: returned.articleAuthorId,// 作者
|
|
|
articleCardinalnumber: returned.articleCardinalnumber, // 基数
|
|
|
// headImgList:obj, // 图片地址
|
|
|
- typographicTypeList:typographicTypeList, // 置顶设置
|
|
|
+ typographicTypeList: typographicTypeList, // 置顶设置
|
|
|
articleSummary: returned.articleSummary, // 摘要
|
|
|
selectLableKeys: returned.tagTypeList, // 标签
|
|
|
selectDepartment: returned.departmentList, // 科室
|
|
|
selectCategory: returned.classificationList, // 分类
|
|
|
+ articleContent: returned.articleContent, // 分类
|
|
|
+ visible: true,
|
|
|
}, () => {
|
|
|
console.log(this.state.typographicTypeList, 'typographicTypeList');
|
|
|
})
|
|
@@ -248,26 +253,29 @@ class ArticleManage extends React.Component {
|
|
|
return state
|
|
|
}
|
|
|
onShow = (type) => {
|
|
|
- const state = this.screen(type)
|
|
|
- console.log(state);
|
|
|
- if (state) {
|
|
|
- this.setState({
|
|
|
- Selected: false,
|
|
|
- })
|
|
|
- } else {
|
|
|
- switch (type) {
|
|
|
- case 'show':
|
|
|
- message.error("请勾选标签");
|
|
|
- break;
|
|
|
- case 'Department':
|
|
|
- message.error("请勾选科室");
|
|
|
- break;
|
|
|
- case 'category':
|
|
|
- message.error("请勾选分类");
|
|
|
- break
|
|
|
- default:
|
|
|
- }
|
|
|
- }
|
|
|
+ this.setState({
|
|
|
+ Selected: false,
|
|
|
+ })
|
|
|
+ // const state = this.screen(type)
|
|
|
+ // console.log(state);
|
|
|
+ // if (state) {
|
|
|
+ // this.setState({
|
|
|
+ // Selected: false,
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // switch (type) {
|
|
|
+ // case 'show':
|
|
|
+ // message.error("请勾选标签");
|
|
|
+ // break;
|
|
|
+ // case 'Department':
|
|
|
+ // message.error("请勾选科室");
|
|
|
+ // break;
|
|
|
+ // case 'category':
|
|
|
+ // message.error("请勾选分类");
|
|
|
+ // break
|
|
|
+ // default:
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
close = (type) => {
|
|
|
const state = this.screen(type)
|
|
@@ -306,47 +314,47 @@ class ArticleManage extends React.Component {
|
|
|
[type]: false
|
|
|
})
|
|
|
}
|
|
|
- offshelfClick = ( type ) => {
|
|
|
- if(type == "bottom"){
|
|
|
+ offshelfClick = (type) => {
|
|
|
+ if (type == "bottom") {
|
|
|
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);
|
|
|
} else {
|
|
|
- const value = this.refs.myInput;
|
|
|
+ const value = this.refs.myInput;
|
|
|
console.log(value);
|
|
|
this.setState({
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
toppingClick = () => {
|
|
|
const data = {}
|
|
|
data.articleId = this.state.stickyPosts
|
|
|
const { typeItem } = this.state
|
|
|
var hicTypeList = [] // // 置顶类型
|
|
|
- var checkedList = this.state.typographicTypeList
|
|
|
+ var checkedList = this.state.typographicTypeList
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
|
for (let k = 0; k < typeItem.length; k++) {
|
|
|
if (checkedList[i] == typeItem[k].label) {
|
|
|
const element = {}
|
|
|
element.typographicTypeId = typeItem[k].typographicTypeId,
|
|
|
- hicTypeList.push(element)
|
|
|
+ hicTypeList.push(element)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
data.typographicTypeList = hicTypeList
|
|
|
console.log(data, 'date-wrapper');
|
|
|
- this.props.dispatch({ type: 'ContentManage/goodsTheShelves', payload: { data } });
|
|
|
- this.setState({
|
|
|
- Topping:false,
|
|
|
+ this.props.dispatch({ type: 'ContentManage/goodsTheShelves', payload: { data } });
|
|
|
+ this.setState({
|
|
|
+ Topping: false,
|
|
|
});
|
|
|
setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
}
|
|
|
onChangeCheckbox = checkedList => {
|
|
|
- console.log(checkedList,'选中的');
|
|
|
+ console.log(checkedList, '选中的');
|
|
|
const { typeItem } = this.state
|
|
|
var selectTypeLable = []
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
@@ -370,7 +378,7 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- handleSubmit = (e,index) => {
|
|
|
+ handleSubmit = (e, index) => {
|
|
|
e.preventDefault();
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
@@ -382,13 +390,13 @@ class ArticleManage extends React.Component {
|
|
|
// ]
|
|
|
const { typeItem } = this.state
|
|
|
var hicTypeList = [] // // 置顶类型
|
|
|
- var checkedList = this.state.typographicTypeList
|
|
|
+ var checkedList = this.state.typographicTypeList
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
|
for (let k = 0; k < typeItem.length; k++) {
|
|
|
if (checkedList[i] == typeItem[k].label) {
|
|
|
const element = {}
|
|
|
element.typographicTypeId = typeItem[k].typographicTypeId,
|
|
|
- hicTypeList.push(element)
|
|
|
+ hicTypeList.push(element)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -399,7 +407,7 @@ class ArticleManage extends React.Component {
|
|
|
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
|
|
@@ -411,6 +419,7 @@ class ArticleManage extends React.Component {
|
|
|
parame.tagTypeList = hicTag
|
|
|
parame.articleContent = this.state.outputHTML
|
|
|
this.props.dispatch({ type: 'ContentManage/addColumn', payload: { parame } });
|
|
|
+ setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -448,7 +457,8 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
- { title: "分类ID", data: "classificationColumnId", type: "text", query: false },
|
|
|
+ { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
|
|
|
+ { title: "分类ID", data: "classificationId", type: "text", query: false },
|
|
|
{ title: "分类名称", data: "classificationDescription", type: "text", query: false },
|
|
|
],
|
|
|
};
|
|
@@ -481,6 +491,7 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
+ { title: "关键词", data: "department_name", type: "text", editor: {}, query: true, hide: true },
|
|
|
{ title: "科室ID", data: "departmentId", type: "text", query: false },
|
|
|
{ title: "科室名称", data: "departmentName", type: "text", query: false },
|
|
|
],
|
|
@@ -505,7 +516,7 @@ class ArticleManage extends React.Component {
|
|
|
preservation.map(val => {
|
|
|
const obj = {}
|
|
|
obj.tagTypeId = val.tagTypeId
|
|
|
- obj.tagTypeName = val.tagTypeGroupName
|
|
|
+ obj.tagTypeName = val.tagTypeName
|
|
|
selectArr.push(obj)
|
|
|
})
|
|
|
that.setState({
|
|
@@ -515,7 +526,10 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
- // { title: "栏目名称", data: "checkStatusA", type: "dropdown" },
|
|
|
+ // {
|
|
|
+ // title: "标签选择", data: "tag_type_group_id", type: "dropdown",
|
|
|
+ // source: { url: WXMpAPI + "/wx/content/tagtype/listTagType" }, query: true, hide: true,
|
|
|
+ // },
|
|
|
{ title: "标签ID", data: "tagTypeId", type: "text", query: false },
|
|
|
{ title: "标签类型", data: "tagTypeGroupName", type: "text", query: false },
|
|
|
{ title: "标签名称", data: "tagTypeName", type: "text", query: false },
|
|
@@ -526,6 +540,27 @@ class ArticleManage extends React.Component {
|
|
|
// 获取栏目
|
|
|
getColumnInformation = () => {
|
|
|
let that = this;
|
|
|
+
|
|
|
+ var baseDate = []
|
|
|
+ let parme = {
|
|
|
+ "filters": [
|
|
|
+ {
|
|
|
+ "field": "column_id",
|
|
|
+ "operate": "equal",
|
|
|
+ "value": 2
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ request({
|
|
|
+ url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
|
|
|
+ method: "post",
|
|
|
+ data: parme
|
|
|
+ }).then((data) => {
|
|
|
+
|
|
|
+ }).catch((error) => {
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
let gridOption = {
|
|
|
title: "权限资源",
|
|
|
title: "关键词",
|
|
@@ -534,25 +569,28 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
pageSize: 10,
|
|
|
checkable: true,
|
|
|
+ afterQuery: function (resultout, filters) {
|
|
|
+
|
|
|
+ },
|
|
|
actions: [{
|
|
|
name: '添加文章', onClick: function () {
|
|
|
that.setState({
|
|
|
dynamicTitle: "添加文章",
|
|
|
- defaultName :"",
|
|
|
- articleTitle :"",
|
|
|
- articleEditorId:"",
|
|
|
- articleCardinalnumber:"",
|
|
|
- typographicTypeList :"",
|
|
|
- articleSummary :"",
|
|
|
- headImgList:[],
|
|
|
- typographicTypeList:[],
|
|
|
- classificationName:[],
|
|
|
- departmentName:[],
|
|
|
- tagTypeName:[],
|
|
|
- selectLableKeys:[],
|
|
|
- selectDepartment:[],
|
|
|
- selectCategory:[],
|
|
|
- articleId:""
|
|
|
+ defaultName: "",
|
|
|
+ articleTitle: "",
|
|
|
+ articleEditorId: "",
|
|
|
+ articleCardinalnumber: "",
|
|
|
+ typographicTypeList: "",
|
|
|
+ articleSummary: "",
|
|
|
+ headImgList: [],
|
|
|
+ typographicTypeList: [],
|
|
|
+ classificationName: [],
|
|
|
+ departmentName: [],
|
|
|
+ tagTypeName: [],
|
|
|
+ selectLableKeys: [],
|
|
|
+ selectDepartment: [],
|
|
|
+ selectCategory: [],
|
|
|
+ articleId: ""
|
|
|
})
|
|
|
that.showModal('visible')
|
|
|
}
|
|
@@ -561,31 +599,17 @@ class ArticleManage extends React.Component {
|
|
|
columns: [
|
|
|
{
|
|
|
title: "栏目名称", data: "article_column_id", type: "dropdown",
|
|
|
- // source: { data: that.state.columnName }, query: true, hide: true
|
|
|
source: { url: WXMpAPI + "/wx/content/column/queryAllColumnsSelection" }, query: true, hide: true,
|
|
|
-
|
|
|
- actions: [{
|
|
|
- name: '行内按钮',
|
|
|
- onChange:function(key,value){
|
|
|
- console.log(key,value)
|
|
|
- }
|
|
|
- }]
|
|
|
- // ,editor:{
|
|
|
- // onChange:function(key,value){
|
|
|
- // console.log(key,value)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // source: { url: ymallAPI + "/ymall/doctor/getLevelList" }
|
|
|
},
|
|
|
{
|
|
|
title: "关联科室", data: "department_id", type: "dropdown",
|
|
|
source: { url: WXMpAPI + "/wx/content/department/queryAllSecondDepartmentsSelection" }, query: true, hide: true
|
|
|
- // source: { data: that.state.relatedDeparTments }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
|
+
|
|
|
title: "文章分类", data: "classification_id", type: "dropdown",
|
|
|
- // source: { url: WXMpAPI + "/wx/content/classification/queryAllClassificationsSelection" }, query: true, hide: true
|
|
|
- source: { data: that.state.classificationArticles }, query: true, hide: true
|
|
|
+ source: { data: baseDate }, query: true, hide: true,
|
|
|
+ // source: { url: WXMpAPI + "/wx/content/column/queryAllColumns" }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
|
title: "置顶类型", data: "typographic_type_id", type: "text",
|
|
@@ -595,7 +619,7 @@ class ArticleManage extends React.Component {
|
|
|
title: "发布状态", data: "article_status", type: "text",
|
|
|
source: { data: that.state.releaseStatus }, query: true, hide: true
|
|
|
},
|
|
|
- { title: "关键词", data: "article_title", type: "text", editor: {}, query: true },
|
|
|
+ { title: "关键词", data: "article_title", type: "text", editor: {}, query: true, hide: true },
|
|
|
|
|
|
|
|
|
{ title: "文章ID", data: "articleId", type: "text", query: false },
|
|
@@ -618,9 +642,12 @@ class ArticleManage extends React.Component {
|
|
|
that.setState({
|
|
|
dynamicTitle: "编辑文章",
|
|
|
articleId:data.articleId,
|
|
|
+ // defaultName:data.column.columnName, // 栏目
|
|
|
+ // tagId:data.column.columnId, // 栏目ID
|
|
|
})
|
|
|
+ console.log(data);
|
|
|
that.editMation(data.articleId);
|
|
|
- // that.queryColumnByColumnId(data.articleId);
|
|
|
+ setTimeout(that.setEditorContentAsync,1000)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -637,7 +664,7 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
that.setState({
|
|
|
Topping: true,
|
|
|
- stickyPosts:data.articleId,
|
|
|
+ stickyPosts: data.articleId,
|
|
|
typographicTypeList: typographicTypeList
|
|
|
}, () => {
|
|
|
|
|
@@ -655,15 +682,15 @@ class ArticleManage extends React.Component {
|
|
|
{
|
|
|
name: '链接', onClick: function (data) {
|
|
|
console.log(data);
|
|
|
- if(data.articleLinkAddress){
|
|
|
+ if (data.articleLinkAddress) {
|
|
|
that.setState({
|
|
|
- httpModal:true,
|
|
|
- textUrl:data.articleLinkAddress
|
|
|
+ httpModal: true,
|
|
|
+ textUrl: data.articleLinkAddress
|
|
|
})
|
|
|
} else {
|
|
|
message.error('暂未配置链接')
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -744,7 +771,7 @@ class ArticleManage extends React.Component {
|
|
|
onCancel={(e) => this.setState({ httpModal: false })}
|
|
|
width={400}
|
|
|
>
|
|
|
- <Input value={ this.state.textUrl } disabled ref="myInput" />
|
|
|
+ <Input value={this.state.textUrl} disabled ref="myInput" />
|
|
|
</Modal>
|
|
|
|
|
|
<Modal
|
|
@@ -753,6 +780,9 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("show")}
|
|
|
onCancel={(e) => this.close("show")}
|
|
|
width={800}
|
|
|
+ footer = {
|
|
|
+ []
|
|
|
+ }
|
|
|
>
|
|
|
<BirdGrid gridOption={this.selectLable()} />
|
|
|
</Modal>
|
|
@@ -763,6 +793,9 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("Department")}
|
|
|
onCancel={(e) => this.close("Department")}
|
|
|
width={800}
|
|
|
+ footer = {
|
|
|
+ []
|
|
|
+ }
|
|
|
>
|
|
|
<BirdGrid gridOption={this.selectDepartment()} />
|
|
|
</Modal>
|
|
@@ -773,6 +806,9 @@ class ArticleManage extends React.Component {
|
|
|
onOk={(e) => this.onShow("category")}
|
|
|
onCancel={(e) => this.close("category")}
|
|
|
width={800}
|
|
|
+ footer = {
|
|
|
+ []
|
|
|
+ }
|
|
|
>
|
|
|
<BirdGrid gridOption={this.selectCategoryt()} />
|
|
|
</Modal>
|
|
@@ -788,129 +824,129 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
>
|
|
|
|
|
|
- <div style={{display:"flex"}}>
|
|
|
- <Form className="login-form" {...layout} style={{ flex: 1 }}>
|
|
|
- <Form.Item label="栏目选择">
|
|
|
- {getFieldDecorator('column', {
|
|
|
- initialValue: this.state.defaultName || "",
|
|
|
- rules: [{ required: true, message: '请选择栏目!' }],
|
|
|
- })(
|
|
|
- <Select onChange={(val) => this.handleChangeColumn(val)}>
|
|
|
- {
|
|
|
- this.state.queryAllColumns && this.state.queryAllColumns.map((item, key) => {
|
|
|
- return <Option value={item.columnName}>{item.columnName}</Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="标题">
|
|
|
- {getFieldDecorator('title', {
|
|
|
- initialValue: this.state.articleTitle || "",
|
|
|
- rules: [{ required: true, message: '请填写标题!' }],
|
|
|
- })(
|
|
|
- <Input />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="封面图片">
|
|
|
- <Upload
|
|
|
- listType="picture-card"
|
|
|
- fileList={this.state.headImgList}
|
|
|
- showUploadList={{ showPreviewIcon: true }}
|
|
|
- onPreview={file => this.onPreview(file)}// 预览
|
|
|
- onRemove={file => this.removeImg("headImgList")}
|
|
|
- onChange={result => this.handleChange(result, "headImgList")}
|
|
|
- action={WXMpAPI + "/wx/file/upload"}
|
|
|
- >
|
|
|
- {this.state.headImgList.length >= 1 ? null : uploadButton}
|
|
|
- </Upload>
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="作者">
|
|
|
- {getFieldDecorator('author', {
|
|
|
- initialValue: this.state.articleEditorId || "",
|
|
|
- rules: [{ required: true, message: '请填写作者!' }],
|
|
|
- })(
|
|
|
- <Input />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="虚假阅读量基数">
|
|
|
- {getFieldDecorator('read', {
|
|
|
- initialValue: this.state.articleCardinalnumber || "",
|
|
|
- rules: [{ required: true, pattern: new RegExp(/^[1-9]\d*$/, "g"), message: '请输入正确基数类型' }],
|
|
|
- })(
|
|
|
- <Input />
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="置顶设置">
|
|
|
- {getFieldDecorator('setup', {
|
|
|
- initialValue: this.state.typographicTypeList || [],
|
|
|
- rules: [{ required: true, message: '请勾选置顶设置' }],
|
|
|
- })(
|
|
|
- <CheckboxGroup
|
|
|
- options={plainOptions}
|
|
|
- onChange={(e) => this.onChangeCheckbox(e)}
|
|
|
- />
|
|
|
- )}
|
|
|
+ <div style={{ display: "flex" }}>
|
|
|
+ <Form className="login-form" {...layout} style={{ flex: 1 }}>
|
|
|
+ <Form.Item label="栏目选择">
|
|
|
+ {getFieldDecorator('column', {
|
|
|
+ initialValue: this.state.defaultName || "",
|
|
|
+ rules: [{ required: true, message: '请选择栏目!' }],
|
|
|
+ })(
|
|
|
+ <Select onChange={(val) => this.handleChangeColumn(val)}>
|
|
|
+ {
|
|
|
+ this.state.queryAllColumns && this.state.queryAllColumns.map((item, key) => {
|
|
|
+ return <Option value={item.columnName}>{item.columnName}</Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="标题">
|
|
|
+ {getFieldDecorator('title', {
|
|
|
+ initialValue: this.state.articleTitle || "",
|
|
|
+ rules: [{ required: true, message: '请填写标题!' }],
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="封面图片">
|
|
|
+ <Upload
|
|
|
+ listType="picture-card"
|
|
|
+ fileList={this.state.headImgList}
|
|
|
+ showUploadList={{ showPreviewIcon: true }}
|
|
|
+ onPreview={file => this.onPreview(file)}// 预览
|
|
|
+ onRemove={file => this.removeImg("headImgList")}
|
|
|
+ onChange={result => this.handleChange(result, "headImgList")}
|
|
|
+ action={WXMpAPI + "/wx/file/upload"}
|
|
|
+ >
|
|
|
+ {this.state.headImgList.length >= 1 ? null : uploadButton}
|
|
|
+ </Upload>
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="作者">
|
|
|
+ {getFieldDecorator('author', {
|
|
|
+ initialValue: this.state.articleEditorId || "",
|
|
|
+ rules: [{ required: true, message: '请填写作者!' }],
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="虚假阅读量基数">
|
|
|
+ {getFieldDecorator('read', {
|
|
|
+ initialValue: this.state.articleCardinalnumber || "",
|
|
|
+ rules: [{ required: true, pattern: new RegExp(/^-?\d*(\.\d*)?$/, "g"), message: '请输入正确基数类型' }],
|
|
|
+ })(
|
|
|
+ <Input />
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="置顶设置">
|
|
|
+ {getFieldDecorator('setup', {
|
|
|
+ initialValue: this.state.typographicTypeList || [],
|
|
|
+ rules: [{ required: true, message: '请勾选置顶设置' }],
|
|
|
+ })(
|
|
|
+ <CheckboxGroup
|
|
|
+ options={plainOptions}
|
|
|
+ onChange={(e) => this.onChangeCheckbox(e)}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {/* <CheckboxGroup
|
|
|
+ {/* <CheckboxGroup
|
|
|
options={plainOptions}
|
|
|
value={this.state.typographicTypeList}
|
|
|
onChange={(e) => this.onChangeCheckbox(e)}
|
|
|
/> */}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="标签">
|
|
|
- <div>
|
|
|
- {
|
|
|
- this.state.selectLableKeys.map((item, key) => {
|
|
|
- return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.tagTypeName}</Button>
|
|
|
- })
|
|
|
- }
|
|
|
- <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('show')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="摘要">
|
|
|
- {getFieldDecorator('content', {
|
|
|
- initialValue: this.state.articleSummary || "",
|
|
|
- rules: [{ required: true, message: '请填写摘要!' }],
|
|
|
- })(
|
|
|
- <Mentions rows="3" placeholder="You can use @ to ref user here"></Mentions>
|
|
|
- )}
|
|
|
- </Form.Item>
|
|
|
- <Form.Item label="选择科室">
|
|
|
- <div>
|
|
|
- {
|
|
|
- this.state.selectDepartment.map((item, key) => {
|
|
|
- return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.departmentName}</Button>
|
|
|
- })
|
|
|
- }
|
|
|
- <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('Department')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
-
|
|
|
- <Form.Item label="选择分类">
|
|
|
- <div>
|
|
|
- {
|
|
|
- this.state.selectCategory.map((item, key) => {
|
|
|
- return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.classificationName}</Button>
|
|
|
- })
|
|
|
- }
|
|
|
- <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('category')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
-
|
|
|
-
|
|
|
- <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>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
- </Form>
|
|
|
- <BraftEditor
|
|
|
- value={editorState}
|
|
|
- onChange={this.handleChangeText}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="标签">
|
|
|
+ <div>
|
|
|
+ {
|
|
|
+ this.state.selectLableKeys.map((item, key) => {
|
|
|
+ return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.tagTypeName}</Button>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('show')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="摘要">
|
|
|
+ {getFieldDecorator('content', {
|
|
|
+ initialValue: this.state.articleSummary || "",
|
|
|
+ rules: [{ required: true, message: '请填写摘要!' }],
|
|
|
+ })(
|
|
|
+ <Mentions rows="3" placeholder="You can use @ to ref user here"></Mentions>
|
|
|
+ )}
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="选择科室">
|
|
|
+ <div>
|
|
|
+ {
|
|
|
+ this.state.selectDepartment.map((item, key) => {
|
|
|
+ return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.departmentName}</Button>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('Department')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+
|
|
|
+ <Form.Item label="选择分类">
|
|
|
+ <div>
|
|
|
+ {
|
|
|
+ this.state.selectCategory.map((item, key) => {
|
|
|
+ return <Button type="dashed" size={80} style={{ marginRight: "30px" }}> {item.classificationName}</Button>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ <Button type="Dashed" size={80} style={{ width: '80px', fontSize: "30px", display: "flex", alignItems: "center", justifyContent: "center" }} onClick={() => this.showChildren('category')} ><Icon type='plus' style={{ fontSize: '20px' }} /></Button>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+
|
|
|
+
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+ </Form>
|
|
|
+ <BraftEditor
|
|
|
+ value={editorState}
|
|
|
+ onChange={this.handleChangeText}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
<BirdGrid gridOption={this.getColumnInformation()} ref="grid" />
|
|
|
</div>
|