|
@@ -26,9 +26,9 @@ class ArticleManage extends React.Component {
|
|
|
editorState: BraftEditor.createEditorState('<p>亮剑集团!</b></p>'), // 设置编辑器初始内容
|
|
|
outputHTML: '<p></p>',
|
|
|
typeItem: [
|
|
|
- { label: "全局置顶", typographicTypeId: "1", disabled: false },
|
|
|
- { label: "科室置顶", typographicTypeId: "2", disabled: false },
|
|
|
- { label: "分类置顶", typographicTypeId: "3", 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 },
|
|
@@ -84,6 +84,10 @@ class ArticleManage extends React.Component {
|
|
|
request({
|
|
|
url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
|
|
|
method: "post",
|
|
|
+ data:{
|
|
|
+ pageIndex:1,
|
|
|
+ pageSize:50
|
|
|
+ }
|
|
|
}).then((data) => {
|
|
|
this.setState({
|
|
|
queryAllColumns: data.items
|
|
@@ -97,6 +101,19 @@ 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 );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updateChange = (e)=>{
|
|
|
+ this.setState({
|
|
|
+ articleTitle:e.target.value
|
|
|
+ }, () => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
handleChangeText = (editorState) => {
|
|
|
this.setState({
|
|
|
editorState: editorState,
|
|
@@ -106,7 +123,6 @@ class ArticleManage extends React.Component {
|
|
|
})
|
|
|
}
|
|
|
setEditorContentAsync = () => {
|
|
|
- console.log('执行了的Async');
|
|
|
this.isLivinig && this.setState({
|
|
|
editorState: BraftEditor.createEditorState(this.state.articleContent)
|
|
|
})
|
|
@@ -129,13 +145,12 @@ class ArticleManage extends React.Component {
|
|
|
});
|
|
|
}
|
|
|
onPreview = (Preview) => {
|
|
|
- console.log(Preview);
|
|
|
+
|
|
|
}
|
|
|
removeImg = (imgSrc) => {
|
|
|
- console.log(imgSrc);
|
|
|
+
|
|
|
}
|
|
|
handleChange = (handle) => {
|
|
|
- console.log(handle,'handle.fileList[0].response.path');
|
|
|
this.setState({
|
|
|
handImgPath: handle.fileList[0] && handle.fileList[0].response ? handle.fileList[0].response.path : "",
|
|
|
headImgList: handle.fileList
|
|
@@ -151,12 +166,14 @@ class ArticleManage extends React.Component {
|
|
|
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 = {}
|
|
@@ -171,7 +188,6 @@ class ArticleManage extends React.Component {
|
|
|
headImgList:[],
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
var typographicTypeList = []
|
|
|
var checkedList = returned.typographicTypeList
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
@@ -188,13 +204,12 @@ class ArticleManage extends React.Component {
|
|
|
articleTitle: returned.articleTitle, // 标题
|
|
|
articleEditorId: returned.articleAuthorId,// 作者
|
|
|
articleCardinalnumber: returned.articleCardinalnumber, // 基数
|
|
|
- // headImgList:obj, // 图片地址
|
|
|
- typographicTypeList: typographicTypeList, // 置顶设置
|
|
|
articleSummary: returned.articleSummary, // 摘要
|
|
|
selectLableKeys: returned.tagTypeList, // 标签
|
|
|
selectDepartment: returned.departmentList, // 科室
|
|
|
selectCategory: returned.classificationList, // 分类
|
|
|
articleContent: returned.articleContent, // 分类
|
|
|
+ typographicTypeList: typographicTypeList, // 置顶设置
|
|
|
visible: true,
|
|
|
}, () => {
|
|
|
console.log(this.state.defaultName,'defaultName');
|
|
@@ -306,7 +321,6 @@ class ArticleManage extends React.Component {
|
|
|
setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
} else {
|
|
|
const value = this.refs.myInput;
|
|
|
- console.log(value);
|
|
|
this.setState({
|
|
|
|
|
|
})
|
|
@@ -329,7 +343,6 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
data.typographicTypeList = hicTypeList
|
|
|
- console.log(data, 'date-wrapper');
|
|
|
this.props.dispatch({ type: 'ContentManage/goodsTheShelves', payload: { data } });
|
|
|
this.setState({
|
|
|
Topping: false,
|
|
@@ -337,7 +350,6 @@ class ArticleManage extends React.Component {
|
|
|
setTimeout(() => this.refs.grid.reload(), 3000);
|
|
|
}
|
|
|
onChangeCheckbox = checkedList => {
|
|
|
- console.log(checkedList, '选中的');
|
|
|
const { typeItem } = this.state
|
|
|
var selectTypeLable = []
|
|
|
for (let i = 0; i < checkedList.length; i++) {
|
|
@@ -354,7 +366,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]);
|
|
|
+ console.log(this.state.queryAllColumns[i].columnId,'uk-icon-ioxhost');
|
|
|
this.setState({
|
|
|
tagId: this.state.queryAllColumns[i].columnId,
|
|
|
});
|
|
@@ -378,7 +390,6 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.state.handImgPath,'this.state.handImgPath');
|
|
|
|
|
|
let hicColumn = {} // 栏目ID
|
|
|
hicColumn.columnId = this.state.tagId
|
|
@@ -387,7 +398,7 @@ class ArticleManage extends React.Component {
|
|
|
parame.articleTitle = values.title;
|
|
|
parame.articleId = this.state.articleId,
|
|
|
parame.articleStatus = index; // 文章状态(0为保存,1为保存并发布,-1下架)
|
|
|
- parame.articleAuthorId = 4; // 作者ID
|
|
|
+ // parame.articleAuthorId = 4; // 作者ID
|
|
|
parame.articleSummary = values.content
|
|
|
parame.articlePhotoaddress = this.state.handImgPath
|
|
|
parame.articleCardinalnumber = Number(values.read)
|
|
@@ -412,11 +423,13 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
filterRules: [
|
|
|
{
|
|
|
- field: "column_id",
|
|
|
+ // field: "column_id",
|
|
|
+ field: "classification_column_id",
|
|
|
operate: "equal",
|
|
|
value: that.state.tagId
|
|
|
}
|
|
|
],
|
|
|
+
|
|
|
pageSize: 10,
|
|
|
checkable: true,
|
|
|
actions: [{
|
|
@@ -424,6 +437,8 @@ class ArticleManage extends React.Component {
|
|
|
onClick: (id, data) => {
|
|
|
if(data.length==0){
|
|
|
message.error("请勾选分类");
|
|
|
+ } else {
|
|
|
+ message.success("保存成功");
|
|
|
}
|
|
|
let selectArr = []
|
|
|
data.map(val => {
|
|
@@ -440,8 +455,9 @@ class ArticleManage extends React.Component {
|
|
|
],
|
|
|
columns: [
|
|
|
{ title: "分类ID", data: "classificationId", type: "text", query: false },
|
|
|
- { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
|
|
|
- { title: "分类名称", data: "classificationDescription", type: "text", query: false },
|
|
|
+ // { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
|
|
|
+ { title: "分类名称", data: "classificationName", type: "text", query: false },
|
|
|
+ // { title: "分类名称", data: "classificationDescription", type: "text", query: false },
|
|
|
],
|
|
|
};
|
|
|
return gridOption
|
|
@@ -461,7 +477,8 @@ class ArticleManage extends React.Component {
|
|
|
onClick: (id, data) => {
|
|
|
if(data.length==0){
|
|
|
message.error("请勾选科室");
|
|
|
- return
|
|
|
+ } else {
|
|
|
+ message.success("保存成功");
|
|
|
}
|
|
|
let selectArr = []
|
|
|
data.map(val => {
|
|
@@ -498,9 +515,9 @@ class ArticleManage extends React.Component {
|
|
|
name: "标签保存",
|
|
|
onClick: (id, preservation) => {
|
|
|
if(preservation.length==0){
|
|
|
- console.log(preservation.length,'loader___1O6A9');
|
|
|
message.error("请勾选标签");
|
|
|
- return
|
|
|
+ } else {
|
|
|
+ message.success("保存成功");
|
|
|
}
|
|
|
let selectArr = []
|
|
|
preservation.map(val => {
|
|
@@ -528,29 +545,40 @@ class ArticleManage extends React.Component {
|
|
|
};
|
|
|
return gridOption
|
|
|
}
|
|
|
- // 获取栏目
|
|
|
- getColumnInformation = () => {
|
|
|
- let that = this;
|
|
|
- var baseDate = []
|
|
|
+ getContentUpdate =( id )=>{
|
|
|
let parme = {
|
|
|
"filters": [
|
|
|
{
|
|
|
"field": "column_id",
|
|
|
"operate": "equal",
|
|
|
- "value": 2
|
|
|
+ "value":id
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
- request({
|
|
|
- url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
|
|
|
+ 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
|
|
|
}).catch((error) => {
|
|
|
|
|
|
});
|
|
|
|
|
|
+ // const data = [
|
|
|
+ // { label:"时间2",value:1},
|
|
|
+ // { label:"时间1",value:12},
|
|
|
+ // { label:"时间2",value:123},
|
|
|
+ // { label:"时间3",value:1234},
|
|
|
+ // ]
|
|
|
+ // this.refs.grid.props.gridOption.columns[3].source.data = data
|
|
|
+ }
|
|
|
+ // 获取栏目
|
|
|
+ getColumnInformation = () => {
|
|
|
+ let that = this;
|
|
|
+ var baseDate = []
|
|
|
+
|
|
|
let gridOption = {
|
|
|
title: "权限资源",
|
|
|
title: "关键词",
|
|
@@ -559,9 +587,6 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
pageSize: 10,
|
|
|
checkable: true,
|
|
|
- afterQuery: function (resultout, filters) {
|
|
|
-
|
|
|
- },
|
|
|
actions: [{
|
|
|
name: '添加文章', onClick: function () {
|
|
|
that.setState({
|
|
@@ -583,6 +608,7 @@ class ArticleManage extends React.Component {
|
|
|
articleId: "",
|
|
|
outputHTML:""
|
|
|
})
|
|
|
+ that.props.form.resetFields();
|
|
|
that.showModal('visible')
|
|
|
}
|
|
|
}
|
|
@@ -599,24 +625,24 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
{
|
|
|
title: "文章分类", data: "classification_id", type: "dropdown",
|
|
|
- source: { data: baseDate }, query: true, hide: true,ieditor: {ap: 'hide', ep: 'hide'}
|
|
|
+ source: { data: [] }, query: true, hide: true
|
|
|
// source: { url: WXMpAPI + "/wx/content/column/queryAllColumns" }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
|
- title: "置顶类型", data: "typographic_type_id", type: "text",
|
|
|
+ title: "置顶类型", data: "typographic_type_id", type: "dropdown",
|
|
|
source: { data: that.state.typeItem }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
|
- title: "发布状态", data: "article_status", type: "text",
|
|
|
+ title: "发布状态", data: "article_status", type: "dropdown",
|
|
|
source: { data: that.state.releaseStatus }, query: true, hide: true
|
|
|
},
|
|
|
- { title: "关键词", data: "", type: "text", query: true, hide: true },
|
|
|
+ { 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 },
|
|
|
+ { title: "创建时间", data: "articleCreateDate", type: "text", query: false },
|
|
|
{ title: "真实浏览量", data: "articleRealpageviews", type: "text", query: false },
|
|
|
{
|
|
|
title: "状态", data: "articleStatus", type: "number", query: false,
|
|
@@ -634,6 +660,7 @@ class ArticleManage extends React.Component {
|
|
|
dynamicTitle: "编辑文章",
|
|
|
articleId:data.articleId,
|
|
|
})
|
|
|
+ that.props.form.resetFields();
|
|
|
console.log(data);
|
|
|
that.editMation(data.articleId);
|
|
|
setTimeout(that.setEditorContentAsync,1000)
|
|
@@ -670,7 +697,6 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
{
|
|
|
name: '链接', onClick: function (data) {
|
|
|
- console.log(data);
|
|
|
if (data.articleLinkAddress) {
|
|
|
that.setState({
|
|
|
httpModal: true,
|
|
@@ -828,14 +854,17 @@ class ArticleManage extends React.Component {
|
|
|
</Select>
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
+
|
|
|
<Form.Item label="标题">
|
|
|
{getFieldDecorator('title', {
|
|
|
initialValue: this.state.articleTitle || "",
|
|
|
rules: [{ required: true, message: '请填写标题!' }],
|
|
|
})(
|
|
|
- <Input key={ this.state.articleTitle }/>
|
|
|
+ <Input/>
|
|
|
+ // <Input onChange={(e)=>this.updateChange(e)}/>
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
+
|
|
|
<Form.Item label="封面图片">
|
|
|
<Upload
|
|
|
listType="picture-card"
|
|
@@ -844,7 +873,7 @@ class ArticleManage extends React.Component {
|
|
|
onPreview={file => this.onPreview(file)}// 预览
|
|
|
onRemove={file => this.removeImg("headImgList")}
|
|
|
onChange={result => this.handleChange(result, "headImgList")}
|
|
|
- action={WXMpAPI + "/wx/file/upload"}
|
|
|
+ action={WXMpAPI + "/wx/content/upload "}
|
|
|
>
|
|
|
{this.state.headImgList.length >= 1 ? null : uploadButton}
|
|
|
</Upload>
|
|
@@ -875,12 +904,6 @@ class ArticleManage extends React.Component {
|
|
|
onChange={(e) => this.onChangeCheckbox(e)}
|
|
|
/>
|
|
|
)}
|
|
|
-
|
|
|
- {/* <CheckboxGroup
|
|
|
- options={plainOptions}
|
|
|
- value={this.state.typographicTypeList}
|
|
|
- onChange={(e) => this.onChangeCheckbox(e)}
|
|
|
- /> */}
|
|
|
</Form.Item>
|
|
|
<Form.Item label="标签">
|
|
|
<div>
|
|
@@ -897,7 +920,7 @@ class ArticleManage extends React.Component {
|
|
|
initialValue: this.state.articleSummary || "",
|
|
|
rules: [{ required: true, message: '请填写摘要!' }],
|
|
|
})(
|
|
|
- <Mentions rows="3" placeholder="You can use @ to ref user here"></Mentions>
|
|
|
+ <Mentions rows="3" value={this.state.articleSummary} placeholder="You can use @ to ref user here"></Mentions>
|
|
|
)}
|
|
|
</Form.Item>
|
|
|
<Form.Item label="选择科室">
|
|
@@ -921,8 +944,6 @@ class ArticleManage extends React.Component {
|
|
|
<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>
|
|
@@ -936,7 +957,7 @@ class ArticleManage extends React.Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
- <BirdGrid gridOption={this.getColumnInformation()} ref="grid" />
|
|
|
+ <BirdGrid handleChange={(key,value)=>this.onChangeGrid(key,value) } gridOption={ this.getColumnInformation()} ref="grid" />
|
|
|
</div>
|
|
|
)
|
|
|
}
|