|
@@ -4,31 +4,11 @@ import { BirdGrid } from 'components/Grid';
|
|
|
import { connect } from "dva";
|
|
|
import 'braft-editor/dist/index.css'
|
|
|
import { config, request, util } from "utils";
|
|
|
-import { BirdForm } from 'components/Form';
|
|
|
-import { SketchPicker } from 'react-color'
|
|
|
-import PropTypes, { string } from 'prop-types'
|
|
|
-import { bindActionCreators } from 'redux';
|
|
|
-import { routerRedux } from 'dva/router'
|
|
|
-import moment from 'moment';
|
|
|
-import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
|
|
|
-const { ymallAPI } = config;
|
|
|
import { Modal, Upload, Select, Form, Input, Button, message, Icon, Checkbox, Mentions } from "antd";
|
|
|
import { type } from 'jquery';
|
|
|
const { WXMpAPI } = config;
|
|
|
import BraftEditor from 'braft-editor'
|
|
|
|
|
|
-const fields = [
|
|
|
- {
|
|
|
- name: '内容',
|
|
|
- key: 'content',
|
|
|
- fieldType: 'richtext',
|
|
|
- groupName: '扩展信息',
|
|
|
- innerProps: {
|
|
|
- height: 500
|
|
|
- }
|
|
|
- }
|
|
|
-];
|
|
|
-
|
|
|
class ArticleManage extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props)
|
|
@@ -99,7 +79,7 @@ class ArticleManage extends React.Component {
|
|
|
componentDidMount() {
|
|
|
this.isLivinig = true
|
|
|
// 3秒后更改编辑器内容
|
|
|
- setTimeout(this.setEditorContentAsync, 3000)
|
|
|
+ setTimeout(this.setEditorContentAsync,500)
|
|
|
// 获取栏目选择数据
|
|
|
request({
|
|
|
url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
|
|
@@ -122,7 +102,7 @@ class ArticleManage extends React.Component {
|
|
|
editorState: editorState,
|
|
|
outputHTML: editorState.toHTML()
|
|
|
}, () => {
|
|
|
- console.log(editorState.toHTML());
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
setEditorContentAsync = () => {
|
|
@@ -155,6 +135,7 @@ class ArticleManage extends React.Component {
|
|
|
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
|
|
@@ -185,6 +166,10 @@ class ArticleManage extends React.Component {
|
|
|
this.setState({
|
|
|
headImgList: list,
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.setState({
|
|
|
+ headImgList:[],
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
var typographicTypeList = []
|
|
@@ -212,7 +197,7 @@ class ArticleManage extends React.Component {
|
|
|
articleContent: returned.articleContent, // 分类
|
|
|
visible: true,
|
|
|
}, () => {
|
|
|
- console.log(this.state.typographicTypeList, 'typographicTypeList');
|
|
|
+ console.log(this.state.defaultName,'defaultName');
|
|
|
})
|
|
|
}).catch((error) => {
|
|
|
|
|
@@ -253,9 +238,9 @@ class ArticleManage extends React.Component {
|
|
|
return state
|
|
|
}
|
|
|
onShow = (type) => {
|
|
|
- this.setState({
|
|
|
- Selected: false,
|
|
|
- })
|
|
|
+ // this.setState({
|
|
|
+ // Selected: false,
|
|
|
+ // })
|
|
|
// const state = this.screen(type)
|
|
|
// console.log(state);
|
|
|
// if (state) {
|
|
@@ -278,25 +263,23 @@ class ArticleManage extends React.Component {
|
|
|
// }
|
|
|
}
|
|
|
close = (type) => {
|
|
|
- const state = this.screen(type)
|
|
|
- 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,
|
|
|
+ })
|
|
|
+ // } else {
|
|
|
+ // switch (type) {
|
|
|
+ // case 'show':
|
|
|
+ // message.error("请勾选标签");
|
|
|
+ // break;
|
|
|
+ // case 'Department':
|
|
|
+ // message.error("请勾选科室");
|
|
|
+ // break;
|
|
|
+ // case 'category':
|
|
|
+ // message.error("请勾选分类");
|
|
|
+ // break
|
|
|
+ // default:
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
showModal = (type, modal) => {
|
|
|
this.setState({
|
|
@@ -383,11 +366,6 @@ class ArticleManage extends React.Component {
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
|
let parame = {}
|
|
|
- // const typeItem = [
|
|
|
- // { label: "全局置顶", typographicTypeId: "1" },
|
|
|
- // { label: "科室置顶", typographicTypeId: "2" },
|
|
|
- // { label: "分类置顶", typographicTypeId: "3" },
|
|
|
- // ]
|
|
|
const { typeItem } = this.state
|
|
|
var hicTypeList = [] // // 置顶类型
|
|
|
var checkedList = this.state.typographicTypeList
|
|
@@ -400,6 +378,7 @@ class ArticleManage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ console.log(this.state.handImgPath,'this.state.handImgPath');
|
|
|
|
|
|
let hicColumn = {} // 栏目ID
|
|
|
hicColumn.columnId = this.state.tagId
|
|
@@ -407,7 +386,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
|
|
@@ -443,6 +422,9 @@ class ArticleManage extends React.Component {
|
|
|
actions: [{
|
|
|
name: "分类保存",
|
|
|
onClick: (id, data) => {
|
|
|
+ if(data.length==0){
|
|
|
+ message.error("请勾选分类");
|
|
|
+ }
|
|
|
let selectArr = []
|
|
|
data.map(val => {
|
|
|
const obj = {}
|
|
@@ -457,8 +439,8 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
- { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
|
|
|
{ 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 },
|
|
|
],
|
|
|
};
|
|
@@ -477,6 +459,10 @@ class ArticleManage extends React.Component {
|
|
|
actions: [{
|
|
|
name: "科室保存",
|
|
|
onClick: (id, data) => {
|
|
|
+ if(data.length==0){
|
|
|
+ message.error("请勾选科室");
|
|
|
+ return
|
|
|
+ }
|
|
|
let selectArr = []
|
|
|
data.map(val => {
|
|
|
const obj = {}
|
|
@@ -491,8 +477,8 @@ 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: "department_name", type: "text", editor: {}, query: true, hide: true },
|
|
|
{ title: "科室名称", data: "departmentName", type: "text", query: false },
|
|
|
],
|
|
|
};
|
|
@@ -506,12 +492,16 @@ class ArticleManage extends React.Component {
|
|
|
url: {
|
|
|
read: WXMpAPI + '/wx/content/tagtype/listTagType',
|
|
|
},
|
|
|
-
|
|
|
pageSize: 10,
|
|
|
checkable: true,
|
|
|
actions: [{
|
|
|
name: "标签保存",
|
|
|
onClick: (id, preservation) => {
|
|
|
+ if(preservation.length==0){
|
|
|
+ console.log(preservation.length,'loader___1O6A9');
|
|
|
+ message.error("请勾选标签");
|
|
|
+ return
|
|
|
+ }
|
|
|
let selectArr = []
|
|
|
preservation.map(val => {
|
|
|
const obj = {}
|
|
@@ -526,11 +516,12 @@ class ArticleManage extends React.Component {
|
|
|
},
|
|
|
],
|
|
|
columns: [
|
|
|
+ { title: "标签ID", data: "tagTypeId", type: "text", query: false },
|
|
|
// {
|
|
|
// title: "标签选择", data: "tag_type_group_id", type: "dropdown",
|
|
|
- // source: { url: WXMpAPI + "/wx/content/tagtype/listTagType" }, query: true, hide: true,
|
|
|
+ // source: { url: WXMpAPI + "/wx/content/tagtype/listTagTypeGroup" }, query:true, hide: true,
|
|
|
// },
|
|
|
- { title: "标签ID", data: "tagTypeId", type: "text", query: false },
|
|
|
+ { title: "标签名称", data: "tag_type_name", type: "contains", editor: {}, query: true, hide: true },
|
|
|
{ title: "标签类型", data: "tagTypeGroupName", type: "text", query: false },
|
|
|
{ title: "标签名称", data: "tagTypeName", type: "text", query: false },
|
|
|
],
|
|
@@ -540,7 +531,6 @@ class ArticleManage extends React.Component {
|
|
|
// 获取栏目
|
|
|
getColumnInformation = () => {
|
|
|
let that = this;
|
|
|
-
|
|
|
var baseDate = []
|
|
|
let parme = {
|
|
|
"filters": [
|
|
@@ -590,13 +580,15 @@ class ArticleManage extends React.Component {
|
|
|
selectLableKeys: [],
|
|
|
selectDepartment: [],
|
|
|
selectCategory: [],
|
|
|
- articleId: ""
|
|
|
+ articleId: "",
|
|
|
+ outputHTML:""
|
|
|
})
|
|
|
that.showModal('visible')
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
columns: [
|
|
|
+ { 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,
|
|
@@ -606,9 +598,8 @@ class ArticleManage extends React.Component {
|
|
|
source: { url: WXMpAPI + "/wx/content/department/queryAllSecondDepartmentsSelection" }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
|
-
|
|
|
title: "文章分类", data: "classification_id", type: "dropdown",
|
|
|
- source: { data: baseDate }, query: true, hide: true,
|
|
|
+ source: { data: baseDate }, query: true, hide: true,ieditor: {ap: 'hide', ep: 'hide'}
|
|
|
// source: { url: WXMpAPI + "/wx/content/column/queryAllColumns" }, query: true, hide: true
|
|
|
},
|
|
|
{
|
|
@@ -619,10 +610,10 @@ 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, hide: true },
|
|
|
+ { title: "关键词", data: "", type: "text", query: true, hide: true },
|
|
|
|
|
|
|
|
|
- { title: "文章ID", data: "articleId", type: "text", query: false },
|
|
|
+
|
|
|
{ title: "标题", data: "articleTitle", type: "text", query: false },
|
|
|
{ title: "作者", data: "articleAuthorId", type: "text", query: false },
|
|
|
{ title: "创建时间", data: "articleCreatedate", type: "text", query: false },
|
|
@@ -642,8 +633,6 @@ 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);
|
|
@@ -677,7 +666,7 @@ class ArticleManage extends React.Component {
|
|
|
offshelf: true,
|
|
|
offshelfId: data,
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
name: '链接', onClick: function (data) {
|
|
@@ -779,7 +768,7 @@ class ArticleManage extends React.Component {
|
|
|
visible={this.state.Selected == "show"}
|
|
|
onOk={(e) => this.onShow("show")}
|
|
|
onCancel={(e) => this.close("show")}
|
|
|
- width={800}
|
|
|
+ width={1200}
|
|
|
footer = {
|
|
|
[]
|
|
|
}
|
|
@@ -792,7 +781,7 @@ class ArticleManage extends React.Component {
|
|
|
visible={this.state.Selected == "Department"}
|
|
|
onOk={(e) => this.onShow("Department")}
|
|
|
onCancel={(e) => this.close("Department")}
|
|
|
- width={800}
|
|
|
+ width={1200}
|
|
|
footer = {
|
|
|
[]
|
|
|
}
|
|
@@ -805,7 +794,7 @@ class ArticleManage extends React.Component {
|
|
|
visible={this.state.Selected == "category"}
|
|
|
onOk={(e) => this.onShow("category")}
|
|
|
onCancel={(e) => this.close("category")}
|
|
|
- width={800}
|
|
|
+ width={1200}
|
|
|
footer = {
|
|
|
[]
|
|
|
}
|