Commit 58e6835e by 潘本斌

1

parent 1a57bc75
import React from "react";
import {
Button,
Modal,
Form,
Input,
Radio,
Cascader,
DatePicker,
Upload,
Icon,
message,
} from "antd";
import { connect } from "react-redux";
// import {gupList, gupfetch} from 'ACTIONS/upload';
import { gupList, gupfetch } from "@/common/UpLoad/redux/actions";
import Editor from "@/common/Editor/editor";
import UpLoad from "@/common/UpLoad";
import moment from "moment";
import validator from "@/common/validatorForm/index";
const FormItem = Form.Item;
class addEdit extends React.Component {
constructor(props) {
super(props);
this.state = {
uploadParams: {},
uploadAction: "",
editor: "",
tags: [],
fileList: [],
responseList: [],
};
this.props.gupfetch();
this.beforeUpload = this.beforeUpload.bind(this);
this.handleUploadChange = this.handleUploadChange.bind(this);
}
componentDidMount() {
const { seeEdit, type } = this.props;
}
//多媒体组件事件
getEditorHtml = editor => {
this.props.onEditor(editor);
};
//上传文件
beforeUpload(file, fileList) {
console.log("检测打印变量=file ", file);
if (file.size > 1024 * 1024 * 50) {
message.error("上传最大限制50mb以内");
return;
}
const { param } = this.props;
if (param !== null) {
this.setState({
uploadParams: {
Filename:
param.dir +
"/" +
file.uid +
"." +
file.name.substr(file.name.length - 3),
key:
param.dir +
"/" +
file.uid +
"." +
file.name.substr(file.name.length - 3),
policy: param.policy,
OSSAccessKeyId: param.accessid,
success_action_status: "200",
signature: param.signature,
},
uploadAction: param.host,
});
this.setState({
hostAndDir: param.host + "/" + param.dir,
fileList: [],
});
}
}
//123
handleUploadChange({ file, fileList }) {
// console.log(123,file.name.split('.')[1])
// if (file.name.indexOf("pdf") == -1) {
// message.error("请上传pdf文件");
// return;
// }
let temp = this.state.fileList;
if (file.status == "removed") {
temp = temp.filter(item => {
return item.uid != file.uid;
});
this.setState({
fileList: temp,
responseList: temp.map(item => {
return {
fileName: item.name,
fileUrl: item.fileUrl
? item.fileUrl
: this.state.hostAndDir +
"/" +
item.uid +
"." +
item.name.substr(item.name.length - 3),
size: item.size + "",
suffix: "." + item.name.split(".")[1],
};
}),
});
} else {
temp.push(fileList.pop());
this.setState({
fileList: temp.map(item => {
return {
uid: item.uid,
name: item.name,
size: item.size,
fileUrl: item.fileUrl,
};
}),
});
this.setState({
responseList: temp.map(item => {
return {
fileName: item.name,
fileUrl: item.fileUrl
? item.fileUrl
: this.state.hostAndDir +
"/" +
item.uid +
"." +
item.name.substr(item.name.length - 3),
size: item.size + "",
suffix: "." + item.name.split(".")[1],
};
}),
});
}
}
normFile = e => {
if (Array.isArray(e)) {
return e;
}
return e && this.state.fileLists;
};
render() {
var fileUrl = "";
var fileName = "";
if (this.state.responseList[0]) {
var fileUrl = this.state.responseList[0].fileUrl;
var fileName = this.state.responseList[0].fileName;
}
const {
visible,
onCancel,
onCreate,
onApprove,
title,
fileList,
form,
seeEdit = {},
type,
} = this.props;
const { uploadParams, uploadAction, tags } = this.state;
const { getFieldDecorator } = form;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 },
},
};
const { id } = this.props.seeEdit;
return (
<Modal
visible={visible}
title={title}
okText="确定"
width={1000}
destroyOnClose
onCancel={onCancel}
footer={
type == "approve" ? (
<>
<Button key="1" type="primary" onClick={() => onApprove(id, 1)}>
通过
</Button>
<Button key="2" onClick={() => onApprove(id, 2)}>
不通过
</Button>
<Button key="3" type="primary" onClick={onCancel}>
取消
</Button>
</>
) : type == "edit" ? (
<>
<Button
key="4"
type="primary"
onClick={() => onCreate(id, fileUrl, fileName)}
>
保存
</Button>
<Button key="5" onClick={onCancel}>
取消
</Button>
</>
) : (
<Button key="6" onClick={onCancel}>
取消
</Button>
)
}
>
<Form>
<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 && seeEdit.content}
disabled={type != "edit" ? true : false}
/>
</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,
})(<Input disabled={type != "edit" ? true : false} />)}
</FormItem>
<FormItem {...formItemLayout} label="支部或部室">
{getFieldDecorator("deptName", {
initialValue: seeEdit && seeEdit.deptName,
})(<Input disabled={type != "edit" ? true : false} />)}
</FormItem>
</Form>
</Modal>
);
}
}
function mapStateToProps(state, ownProps) {
return {
param: state.uploadParam.param,
fileList: state.uploadParam.fileList,
ificationList: state.article.ificationList,
seeEdit: state.article.seeEdit,
};
}
function mapDispatchToProps(dispatch) {
return {
gupfetch: () => dispatch(gupfetch()),
gupList: fileList => dispatch(gupList(fileList)),
};
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(Form.create()(addEdit));
import React from "react";
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select } from "antd";
const FormItem = Form.Item;
const RangePicker = DatePicker.RangePicker;
const Option = Select.Option;
class Header extends React.Component {
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
this.props.headForm(values);
}
});
};
reset = () => {
this.props.headForm({});
};
render() {
const { getFieldDecorator, resetFields } = this.props.form;
const List = [
{ value: 0, text: "删除" },
{ value: 1, text: "草稿" },
{ value: 2, text: "待审核" },
{ value: 3, text: "待发布" },
{ value: 4, text: "已发布" },
{ value: 5, text: "不通过" },
];
const option = List.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
const types =
this.props.menuList.length > 0
? this.props.menuList.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.cnName}
</Option>
);
})
: [];
return (
<Row>
<Form
layout="inline"
onSubmit={this.handleSubmit}
style={{ paddingBottom: 30 }}
>
<Col span={22} offset={1}>
<FormItem label="投稿ID:">
{getFieldDecorator("number")(
<Input style={{ width: "200px" }} placeholder="请输入投稿ID" />
)}
</FormItem>
<FormItem label="投稿类型:">
{getFieldDecorator("typeId")(
<Select style={{ width: "200px" }} placeholder="请选择投稿类型">
{types}
</Select>
)}
</FormItem>
<FormItem label="作者:">
{getFieldDecorator("author")(
<Input style={{ width: "200px" }} placeholder="请输入作者" />
)}
</FormItem>
<FormItem label="文章标题:">
{getFieldDecorator("fileName")(
<Input
style={{ width: "200px" }}
placeholder="请输入文章标题"
/>
)}
</FormItem>
<FormItem label="投稿状态:">
{getFieldDecorator("state")(
<Select style={{ width: "200px" }} placeholder="请选择投稿状态">
{option}
</Select>
)}
</FormItem>
<FormItem label="审核时间">
{getFieldDecorator("time")(
<RangePicker style={{ width: "220px" }} format="YYYY-MM-DD" />
)}
</FormItem>
</Col>
<Col span={6} offset={18}>
<FormItem>
<Button
type="primary"
onClick={() => {
resetFields();
this.reset();
}}
>
重置
</Button>
<Button
type="primary"
htmlType="submit"
style={{ marginLeft: "30px" }}
>
查询
</Button>
</FormItem>
</Col>
</Form>
</Row>
);
}
}
const Head = Form.create()(Header);
export default Head;
import { message } from "antd";
import request from "@/util/request.js";
import apis from "./api";
const {
postReleasesApi,
postUnReleasesApi,
postInsertApi,
postUpdataApi,
getApproveApi,
getUnapproveApi,
getSeeEditApi,
searchApi,
listApi,
menuApi,
} = apis;
//投稿管理
export const IFICATIONLIST = "IFICATIONLIST";
// let ificationList = createAction(IFICATIONLIST);
export const TABLELIST = "TABLELIST";
export const MENULIST = "MENULIST";
// let tableList = createAction(TABLELIST);
export const CLASSIFYSELECT = "CLASSIFYSELECT";
// let classifySelect = createAction(CLASSIFYSELECT);
export const SEEEDIT = "SEEEDIT";
// let seeEdit = createAction(SEEEDIT);
export const NULLSEEEDIT = "NULLSEEEDIT";
// let nullSeeEdit = createAction(NULLSEEEDIT);
// 获取列表
export function getList(data, callback) {
return dispatch => {
return request({
url: listApi,
data: data,
}).then(res => {
dispatch({ type: TABLELIST, data: res.data });
if (callback) {
callback();
}
});
};
}
//查看
export function getSeeEdit(data, callback) {
return dispatch => {
return request({
url: getSeeEditApi,
data: data,
}).then(res => {
dispatch({ type: SEEEDIT, data: res.data });
if (callback) {
callback();
}
});
};
}
// 搜索
export function getSearch(data, callback) {
return dispatch => {
return request({
url: searchApi,
data: data,
}).then(res => {
dispatch({ type: IFICATIONLIST, data: arr });
if (callback) {
callback();
}
});
};
}
// 审批通过
export function getApprove(data, callback) {
return dispatch => {
return request({
url: getApproveApi,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
// 审批不通过
export function getUnapprove(data, callback) {
return dispatch => {
return request({
url: getUnapproveApi,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
//发布
export function postReleases(data, callback) {
return dispatch => {
return request({
url: postReleasesApi,
data: data,
}).then(res => {
dispatch({ type: TABLELIST, data: res.data });
if (callback) {
callback();
}
});
};
}
//取消发布
export function postUnReleases(data, callback) {
return dispatch => {
return request({
url: postUnReleasesApi,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
//编辑
export function postUpdata(data, callback) {
return dispatch => {
return request({
url: postUpdataApi,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
//菜单
export function menu(data, callback) {
return dispatch => {
return request({
url: menuApi,
data: data,
}).then(res => {
dispatch({ type: MENULIST, data: res.data });
if (callback) {
callback();
}
});
};
}
import services from "@/services/serve";
export default {
postReleasesApi: `POST ${services.webManage}/site/classify/publication/releases`, //id
postUnReleasesApi: `POST ${services.webManage}/site/classify/publication/unreleases`, //id
postInsertApi: `POST ${services.webManage}/site/classify/publication/insert`,
getSeeEditApi: `GET ${services.webManage}/site/classify/publication/view`, //id
postUpdataApi: `POST ${services.webManage}/site/classify/publication/update`,
getApproveApi: `GET ${services.webManage}/site/classify/publication/approve`, //id
getUnapproveApi: `GET ${services.webManage}/site/classify/publication/unApprove`, //id
searchApi: `GET ${services.webManage}/site/classify/publication/listbyName`, //?name=''&siteId
listApi: `POST ${services.webManage}/site/classify/publication/list`,
menuApi: `GET ${services.base}/system/dictionary/child/list`,
};
// 资讯管理
// import {
// IFICATIONLIST,
// TABLELIST,
// CLASSIFYSELECT,
// SEEEDIT,
// NULLSEEEDIT,
// } from "../../actions/information/informationManag";
const initialState = {
ificationList: null,
tableList: null,
classifySelect: null,
seeEdit: null,
menuList: null,
};
function article(state = initialState, action) {
switch (action.type) {
//获取资讯分类
case "IFICATIONLIST":
return Object.assign({}, state, {
ificationList: action.data,
});
//获取Table List
case "TABLELIST":
return Object.assign({}, state, {
tableList: action.data,
});
//获取父级分类
case "CLASSIFYSELECT":
return Object.assign({}, state, {
classifySelect: action.data,
});
//获取查看信息
case "SEEEDIT":
return Object.assign({}, state, {
seeEdit: action.data,
});
//清seeEdit
case "NULLSEEEDIT":
return Object.assign({}, state, {
seeEdit: null,
});
case "MENULIST":
return Object.assign({}, state, {
menuList: action.data,
});
default:
return state;
}
}
export default article;
.pm-content {
padding: 20px;
padding-top: 0;
.ant-tree li .ant-tree-node-content-wrapper {
width: 85%;
}
.ant-tree li {
white-space: normal;
}
.pm-tree {
font-size: 15px;
}
.pmEditIcon {
:hover {
color: #0e77ca;
}
margin-left: 10px;
}
}
.marr10 {
margin-right: 10px;
}
.comment {
.dispno {
display: none;
}
.wid40 {
width: 40%;
}
.wid50 {
width: 50%;
}
.fl {
float: left;
}
.fr {
float: right;
}
.mar40 {
margin: 10px;
.ant-input-search-button {
width: 100%;
}
.editable-cell {
display: inline-block;
}
}
.marb40 {
margin-bottom: 10px;
}
.marl20 {
margin-left: 20px;
}
.marl40 {
margin-left: 40px;
}
.ovehid {
overflow: hidden;
}
.otwhen {
width: 260px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-bottom: 0;
}
.comment-pagination {
text-align: center;
margin-top: 20px;
}
}
.steps-content {
margin-top: 16px;
border: 1px dashed #e9e9e9;
border-radius: 6px;
background-color: white;
min-height: 320px;
text-align: center;
padding-top: 20px;
}
.steps-action {
margin-top: 24px;
}
// .ant-form-explain {
// float: left;
// }
.train-list-pagination {
margin-top: 20px;
text-align: center;
}
.custom-filter-dropdown {
padding: 8px;
border-radius: 6px;
background: #fff;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}
.custom-filter-dropdown input {
width: 130px;
margin-right: 8px;
}
.highlight {
color: #f50;
}
.third {
overflow: hidden;
}
.qclist {
display: none;
}
.treeTtitle {
span[draggable] {
width: 85% !important;
}
}
\ No newline at end of file
......@@ -237,13 +237,24 @@ class addEdit extends React.Component {
};
let residences;
if (this.props.ificationList) {
console.log(this.props.ificationList);
residences = this.props.ificationList.map((item, index) => {
if (item.data.length > 0) {
return {
value: item.id,
label: item.name,
children: item.data.map((items, indexs) => {
return { value: items.id, label: items.name };
return {
value: items.id,
label: items.name,
children: items.childClassifyNews.map((itemss, indexss) => {
return {
value: itemss.id,
label: itemss.name,
children: [],
};
}),
};
}),
};
} else {
......@@ -336,6 +347,19 @@ class addEdit extends React.Component {
</div>
)}
</FormItem>
<FormItem {...formItemLayout} label="图片来源">
{getFieldDecorator("imgSource", {
initialValue: seeEdit && seeEdit.imgSource,
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入图片来源", 50);
},
},
],
})(<Input disabled={type == "look" ? !false : false} />)}
</FormItem>
{/* <FormItem {...formItemLayout} label={"封面logo"}>
{getFieldDecorator('logoPath', {
initialValue:seeEdit?[{uid: 1, status: 'done', reponse: 'Server Error 500',url: seeEdit.logoPath}]:[],
......@@ -361,6 +385,19 @@ class addEdit extends React.Component {
],
})(<Input disabled={type == "look" ? !false : false} />)}
</FormItem>
<FormItem {...formItemLayout} label="文章副标题">
{getFieldDecorator("titleSub", {
initialValue: seeEdit && seeEdit.titleSub,
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入文章副标题", 50);
},
},
],
})(<Input disabled={type == "look" ? !false : false} />)}
</FormItem>
<FormItem {...formItemLayout} label="文章类型">
{getFieldDecorator("type", {
initialValue: seeEdit && [seeEdit.typeOne, seeEdit.typeTwo],
......@@ -369,9 +406,10 @@ class addEdit extends React.Component {
],
})(
<Cascader
multiple
options={residences}
onChange={this.loadData}
disabled={type == "look" ? !false : false}
// disabled={type == "look" ? !false : false}
changeOnSelect={true}
placeholder="请选择"
/>
......
......@@ -136,6 +136,9 @@ class TreeItem extends React.Component {
defaultValue: { name: data.name, description: data.description },
});
}
if (state === "3") {
this.setState({ visible: true, name: "新增一级分类", defaultValue: {} });
}
}
handleOk() {
......@@ -149,6 +152,11 @@ class TreeItem extends React.Component {
parentId: data.id,
...values,
});
} else if (this.state.name == "新增一级分类") {
postAddNewsLists({
parentId: 0,
...values,
});
} else if (this.state.name == "编辑分类") {
postEditNewsLists({ parentId: data.parentId, id: data.id, ...values });
}
......@@ -336,6 +344,16 @@ class TreeItem extends React.Component {
className={Styles.pmEditIcon}
onClick={() => this.showModal("1")}
/>
<Icon
type="edit"
className={Styles.pmEditIcon}
onClick={() => this.showModal("2")}
/>
{/* <Icon
type="delete"
className={Styles.pmEditIcon}
onClick={() => this.onDelete()}
/> */}
</span>
)
: ""}
......@@ -375,6 +393,7 @@ class Information extends React.Component {
super(props);
this.state = {
visible: false,
showEdit: false,
getUrl: "",
getTags: "",
typeId: "2",
......@@ -660,6 +679,25 @@ class Information extends React.Component {
showModal = () => {
this.setState({ visible: true, type: "add" });
};
showEidt = () => {
this.setState({ showEdit: true });
};
editOk = () => {
this.props.form.validateFields((errors, values) => {
if (!!errors) {
return error;
}
this.AddNewsList({
parentId: 0,
...values,
});
this.setState({ showEdit: false });
});
};
editCancel = () => {
this.setState({ showEdit: false });
};
//查看 编辑
seeEdit = (record, type) => {
let _this = this;
......@@ -702,6 +740,8 @@ class Information extends React.Component {
typeOne: values.type[0],
typeTwo: values.type[1] ? values.type[1] : 0,
author: values.author,
imgSource: values.imgSource,
titleSub: values.titleSub,
releaseTime: values.releaseTime,
linkUrl: values.linkUrl,
content: editor ? editor : this.props.seeEdit.content,
......@@ -784,6 +824,17 @@ class Information extends React.Component {
};
render() {
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
};
//树形控件
const loopss = data =>
data.map(item => {
......@@ -1034,6 +1085,9 @@ class Information extends React.Component {
borderRadius: 5,
}}
>
<Button type="primary" onClick={() => this.showEidt()}>
新增一级分类
</Button>
<Tree
className="draggable-tree"
draggable
......@@ -1067,6 +1121,35 @@ class Information extends React.Component {
logo={this.props.seeEdit ? this.props.seeEdit.logoPath : null}
/>
)}
<Modal
className="sort-modal"
visible={this.state.showEdit}
title="新增一级分类"
onOk={this.editOk}
onCancel={this.editCancel}
destroyOnClose
>
<Form>
<FormItem label="分类名称:" {...formItemLayout}>
{getFieldDecorator("name", {
rules: [{ required: true, message: "请输入分类名称!" }],
})(
<Input
placeholder="请输入分类名称!(50个字以内)"
maxLength={50}
/>
)}
</FormItem>
<FormItem label="分类描述:" {...formItemLayout}>
{getFieldDecorator("description")(
<TextArea
placeholder="请输入分类描述!(500个字以内)"
maxLength={500}
/>
)}
</FormItem>
</Form>
</Modal>
</div>
);
}
......@@ -1101,4 +1184,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Information);
export default connect(
mapStateToProps,
mapDispatchToProps
)(Form.create()(Information));
......@@ -716,7 +716,7 @@ class News extends React.Component {
return (
<div className={Style.mar40}>
<Breadcrumb title="消息管理"/>
<Breadcrumb title="消息管理" />
<div className={Style.newsHead}>
<QueryForm
QueryForm={this.QueryForm}
......@@ -743,20 +743,20 @@ class News extends React.Component {
</div>
<Tabs defaultActiveKey="1" animated={false} onChange={this.callback}>
<TabPane tab="自定义消息" key="1">
<Table
rowKey={row => row.id}
dataSource={handlemessagetable?handlemessagetable.records:[]}
columns={custom}
pagination={custompagination}
/>
<Table
rowKey={row => row.id}
dataSource={handlemessagetable ? handlemessagetable.records : []}
columns={custom}
pagination={custompagination}
/>
</TabPane>
<TabPane tab="系统消息模板" key="2">
<Table
rowKey={row => row.id}
dataSource={handlemessagetable?handlemessagetable.records:[]}
columns={system}
pagination={systempagination}
/>
<Table
rowKey={row => row.id}
dataSource={handlemessagetable ? handlemessagetable.records : []}
columns={system}
pagination={systempagination}
/>
</TabPane>
</Tabs>
{this.state.customvisible && customsee && (
......
......@@ -69,7 +69,7 @@ const {
getAllSiteListApi,
getLivePortalList,
getNewsList,
addNewsSelect
addNewsSelect,
} = system;
import { message } from "antd";
......@@ -205,8 +205,6 @@ export function unReleaseSite(data, callback) {
};
}
export function AddBannerUploadPolicy(callback) {
return dispatch => {
return request({
......@@ -219,11 +217,11 @@ export function AddBannerUploadPolicy(callback) {
};
}
export function getNewsListAction(obj,callback) {
export function getNewsListAction(obj, callback) {
return dispatch => {
return request({
url: getNewsList,
data:obj
data: obj,
}).then(json => {
if (callback) {
callback(json);
......@@ -232,12 +230,11 @@ export function getNewsListAction(obj,callback) {
};
}
export function saveNewsSelect(obj,callback) {
export function saveNewsSelect(obj, callback) {
return dispatch => {
return request({
url: addNewsSelect,
data:obj
data: obj,
}).then(json => {
if (callback) {
callback(json);
......@@ -246,11 +243,11 @@ export function saveNewsSelect(obj,callback) {
};
}
//获取精品内容列表
export function getPayContentListAction(obj,callback) {
export function getPayContentListAction(obj, callback) {
return dispatch => {
return request({
url: getHomeTrainListApi+"/v2",
data:obj
url: getHomeTrainListApi + "/v2",
data: obj,
}).then(json => {
if (callback) {
callback(json);
......@@ -259,8 +256,6 @@ export function getPayContentListAction(obj,callback) {
};
}
//登陆页配置
export function loginConfig(id) {
// let url = api.doorUrl + "/portal/login/view?terminalId=" + id;
......@@ -440,7 +435,7 @@ export function removeTemplate(id) {
}
// //banner排序
export function ListSorting(data = {}, callback = () => { }) {
export function ListSorting(data = {}, callback = () => {}) {
// let url = api.doorUrl + "/portal/template/selected/image/drag";
let param = {
sourceId: data.bottom,
......@@ -504,7 +499,7 @@ export function delBannerList(ID, homeId, callback) {
}
//首页配置--选择已有图片列表
export function existBannerList(data, callback = () => { }) {
export function existBannerList(data, callback = () => {}) {
// let url = api.doorUrl + "/portal/template/selected/list";
return dispatch => {
// excute.post(url, data, function (json) {
......@@ -521,7 +516,7 @@ export function existBannerList(data, callback = () => { }) {
};
}
//首页配置--选择已有图片列表--新增数据
export function AddBannerList(data, callback = () => { }) {
export function AddBannerList(data, callback = () => {}) {
// let url = api.doorUrl + "/portal/template/image/list/insert";
return dispatch => {
// excute.post(url, data, function (json) {
......@@ -535,7 +530,7 @@ export function AddBannerList(data, callback = () => { }) {
}
// //首页配置--新增banner数据
export function AddBanner(data, callback = () => { }) {
export function AddBanner(data, callback = () => {}) {
// let url = api.doorUrl + "/portal/template/image/upload";
return dispatch => {
// excute.post(url, data, function (json) {
......@@ -1023,7 +1018,6 @@ export function downModule(id, callback) {
type: 1,
},
}).then(res => {
dispacth({
type: UPMODULE,
data: res.data,
......@@ -1114,7 +1108,7 @@ export function getAlbumClassify(params) {
!(
"children" in
arr[arr.length - 1].children[
arr[arr.length - 1].children.length - 1
arr[arr.length - 1].children.length - 1
]
)
) {
......@@ -1499,7 +1493,8 @@ export function searchAlbumList(data, callback) {
url: searchAlbumListApi,
data: data,
}).then(json => {
if (json.code == "1000") {//bug-121460-cwj
if (json.code == "1000") {
//bug-121460-cwj
if (callback) {
callback(json);
}
......@@ -1530,7 +1525,10 @@ export function getLiveDetail(id, callback) {
data: { id },
}).then(json => {
// dispatch({type: "LIVE_DETAIL_DOOR", data: json.data})
dispatch({ type: "LIVE_DETAIL_DOOR", payload: { liveDetailDoor: json.data } })
dispatch({
type: "LIVE_DETAIL_DOOR",
payload: { liveDetailDoor: json.data },
});
if (callback) {
callback(json);
}
......@@ -1572,7 +1570,6 @@ export function getConnectReport(data, callback) {
url: getConnectReportApi,
data: data,
}).then(res => {
if (res.code === "1000") {
dispatch({ type: "REPORT_CONNECT_LIST", data: res.data });
if (callback) {
......@@ -1593,7 +1590,6 @@ export function savePushReport(data, callback) {
url: savePushReportApi,
data: data,
}).then(res => {
if (res.code === "1000") {
if (callback) {
callback();
......@@ -1613,7 +1609,6 @@ export function topReport(data, callback) {
url: topReportApi,
data: data,
}).then(res => {
if (res.code === "1000") {
// dispatch({type:"REPORT_CONNECT_LIST",data:res.data})
if (callback) {
......@@ -1634,7 +1629,6 @@ export function deleteReport(data, callback) {
url: deleteReportApi,
data: data,
}).then(res => {
if (res.code === "1000") {
// dispatch({type:"REPORT_CONNECT_LIST",data:res.data})
if (callback) {
......@@ -1655,7 +1649,6 @@ export function unPushReport(data, callback) {
url: unPushReportApi,
data: data,
}).then(res => {
if (res.code === "1000") {
dispatch({ type: "REPORT_UNPUSH_LIST", data: res.data });
if (callback) {
......@@ -1676,7 +1669,6 @@ export function updatePushTime(data, callback) {
url: updatePushTimeApi,
data: data,
}).then(res => {
if (res.code === "1000") {
// dispatch({type:"REPORT_CONNECT_LIST",data:res.data})
if (callback) {
......@@ -1716,4 +1708,3 @@ export function getLivePortalListAction(data, callback) {
});
};
}
......@@ -17,7 +17,7 @@ function handleFocus() {
}
const columns = [
{
title: "调研时间",
title: "活动时间",
dataIndex: "time",
key: "time",
render: (text, record, index) => {
......@@ -29,7 +29,7 @@ const columns = [
},
},
{
title: "调研名称",
title: "活动名称",
dataIndex: "acname",
key: "acname",
},
......@@ -77,6 +77,7 @@ class SurveyAddactivity extends React.Component {
pageSize: this.state.pageSize,
name: this.state.value,
state: this.state.state,
bizType: 2,
});
}
componentWillReceiveProps(nextProps) {
......@@ -119,6 +120,7 @@ class SurveyAddactivity extends React.Component {
status: status,
shelves: this.state.shelves,
state: this.state.state,
bizType: 2,
name: this.state.value,
});
}
......@@ -129,6 +131,7 @@ class SurveyAddactivity extends React.Component {
this.props.onGetSurveyList({
pageNo: page,
state: this.state.state,
bizType: 2,
pageSize: size,
status: status,
});
......@@ -140,6 +143,7 @@ class SurveyAddactivity extends React.Component {
pageSize: this.state.pageSize,
shelves: this.state.shelves,
state: this.state.state,
bizType: 2,
name: this.state.value,
});
}
......@@ -169,7 +173,7 @@ class SurveyAddactivity extends React.Component {
<div style={{ display: "inline-flex", width: "45%" }}>
<Col span={24}>
<Search
placeholder="请输入调研名称"
placeholder="请输入投票名称"
onSearch={this.handleSearch}
onChange={this.handleGetValue}
enterButton
......
......@@ -478,7 +478,7 @@ class addplan extends React.Component {
return (
<div style={{ marginTop: "20px" }}>
<Tabs defaultActiveKey="课程" onChange={callback}>
<TabPane tab="课程" key="课程">
{/* <TabPane tab="课程" key="课程">
<Course
selectedCourseRowKeys={this.selectedCourseRowKeys}
activitylist={this.props.activitylist}
......@@ -497,8 +497,8 @@ class addplan extends React.Component {
selectedExamRowKeys={this.selectedExamRowKeys}
activitylist={this.props.activitylist}
/>
</TabPane>
<TabPane tab="调研" key="调研">
</TabPane> */}
<TabPane tab="投票" key="投票">
<Survey
selectedSurveyRowKeys={this.selectedSurveyRowKeys}
activitylist={this.props.activitylist}
......@@ -510,7 +510,7 @@ class addplan extends React.Component {
{/*activitylist={this.props.activitylist}*/}
{/*/>*/}
{/*</TabPane>*/}
<TabPane tab="直播" key="直播">
{/* <TabPane tab="直播" key="直播">
<Live
selectedCourseRowKeys={this.selectedLiveRowKeys}
activitylist={this.props.activitylist}
......@@ -558,7 +558,7 @@ class addplan extends React.Component {
selectedCourseRowKeys={this.selectedCourseRowKeys}
activitylist={this.props.activitylist}
/>
</TabPane>
</TabPane> */}
</Tabs>
<div style={{ marginTop: 24 }}>
<Button type="primary" onClick={this.activitysave}>
......
......@@ -380,7 +380,7 @@ class DragSortingTable extends React.Component {
console.log("====================================");
console.log(values);
console.log("====================================");
if (!!errors) {
error = errors;
this.setState({
......@@ -557,7 +557,7 @@ class DragSortingTable extends React.Component {
// delete param.conditionPostFinishNum;
// delete param.conditionPostActivityIds;
// }
const _this = this
const _this = this;
const { pageNo, pageSize } = this.state;
this.props.onUpdateplan(param, (code, msg) => {
if (code === "1000") {
......@@ -575,7 +575,10 @@ class DragSortingTable extends React.Component {
(pageNo - 1) * pageSize,
pageNo * pageSize
),
pagePre: _this.props.planlist.slice(0, (pageNo - 1) * pageSize),
pagePre: _this.props.planlist.slice(
0,
(pageNo - 1) * pageSize
),
pageAfter: _this.props.planlist.slice(pageNo * pageSize),
});
}
......@@ -739,7 +742,7 @@ class DragSortingTable extends React.Component {
style={{ marginLeft: "10px", color: "#00CCFF" }}
onClick={() => this.handleNew(record)}
>
{intl.get("Change") || "修改"}
{intl.get("Change") || "修改"}
</a>
<Popconfirm
title="确定要删除吗?"
......@@ -747,7 +750,9 @@ class DragSortingTable extends React.Component {
cancelText={intl.get("Cancel").d("取消")}
onConfirm={() => this.onDelete(record)}
>
<a style={{ marginLeft: "10px", color: "#00CCFF" }}>{intl.get("Delete") || "删除"}</a>
<a style={{ marginLeft: "10px", color: "#00CCFF" }}>
{intl.get("Delete") || "删除"}
</a>
</Popconfirm>
{this.state.pageNo == 1 && index == 0 ? (
<a style={{ marginLeft: "10px", color: "#D9D9D9" }}>上移</a>
......@@ -841,10 +846,9 @@ class DragSortingTable extends React.Component {
textAlign: "left",
}}
>
<Collapse defaultActiveKey={["1"]}>
<Panel header="计划信息" key="1">
{/* <Collapse defaultActiveKey={["1"]}> */}
{/* <Panel header="计划信息" key="1">
{console.log(this.state)}
{/*<Link href="#Link-Props" title="Link Props" />*/}
<Info
ref={c => (this.checkinfoplan = c)}
infoData={this.state.infoData}
......@@ -861,41 +865,25 @@ class DragSortingTable extends React.Component {
planlist={this.props.planlist}
onGetAcList={this.props.onGetAcList}
/>
</Panel>
<Panel forceRender={true} header="计划内容" key="2">
<Content
ref={c => (this.connectplan = c)}
trainId={this.props.trainId}
tpPlanId={this.state.tpPlanId}
plantype={this.state.plantype}
title={title}
reset={() => this.reset()}
/>
</Panel>
<Panel forceRender={true} header="设置" key="3">
{this.state.plantype == "新增计划" ? (
// <Remind
// ref={obj => (this.remind = obj)}
// title={title}
// defaultValue={this.state.defaultValue}
// newsList={newsList}
// />
</Panel> */}
{/* <Panel forceRender={true} header="计划内容" key="2"> */}
<Content
ref={c => (this.connectplan = c)}
trainId={this.props.trainId}
tpPlanId={this.state.tpPlanId}
plantype={this.state.plantype}
title={title}
reset={() => this.reset()}
/>
{/* </Panel> */}
{/* <Panel forceRender={true} header="设置" key="3">
{this.state.plantype == "新增计划" ? (
<MessageRemind
formItemLayout={formItemLayout}
relationType={1}
wrappedComponentRef={form => (this.messageRemind = form)}
/>
) : (
// this.props.planSeeting.remindVo && (
// <Remind
// ref={obj => (this.remind = obj)}
// title={title}
// defaultValue={this.state.defaultValue}
// seeting={this.props.planSeeting.remindVo}
// newsList={newsList}
// />
<MessageRemind
formItemLayout={formItemLayout}
usable={usable}
......@@ -917,8 +905,8 @@ class DragSortingTable extends React.Component {
title={title}
number={this.state.number}
/>
</Panel>
</Collapse>
</Panel> */}
{/* </Collapse> */}
{(this.props.title !== "查看项目" && (
<div style={{ paddingTop: "20px", textAlign: "center" }}>
<Button onClick={() => this.onHideModal()}>取消</Button>
......@@ -983,4 +971,6 @@ function mapDispatchToProps(dispatch) {
tpPlanMove: (obj, callback) => dispatch(tpPlanMove(obj, callback)),
};
}
export default connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true })(Plan);
export default connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true,
})(Plan);
......@@ -18,6 +18,7 @@ const {
editRangeThird,
viewRange,
getKindList,
getActiveityList,
saveKind,
deleteKind,
updateKind,
......@@ -252,6 +253,16 @@ export function getTrainFirst(param, callback) {
const arr = {
// 项目名称
name: temp.name,
subtitle: temp.subtitle,
detailsImage: temp.detailsImage,
pictureSource: temp.pictureSource,
activityAddress: temp.activityAddress,
organizer: temp.organizer,
coOrganizer: temp.coOrganizer,
tips: temp.tips,
other: temp.other,
activityReward: temp.activityReward,
videoUrl: temp.videoUrl,
// 项目Logo
logoImg: temp.logoImg,
// 项目分类
......@@ -391,6 +402,31 @@ export function trainKind(param) {
});
};
}
export function activeityList(param) {
return dispatch => {
return request({
url: getActiveityList,
data: param,
}).then(res => {
const temp = res.data;
const arr = [];
if (temp !== null) {
for (let i = 0; i < temp.length; i++) {
arr.push({
//名字
name: temp[i].name,
//id
id: temp[i].id,
//描述
description: temp[i].description,
});
}
}
dispatch({ type: GET_TRAIN_KIND_LIST, data: arr });
});
};
}
// 项目分类保存
export function trainKindSave(param, callback) {
return dispatch => {
......
......@@ -15,6 +15,7 @@ export default {
editRangeThird: `POST ${services.webManage}/trainingProject/step/three/save`,
viewRange: `GET ${services.webManage}/trainingProject/visibleRange/view`,
getActiveityList: `GET ${services.webManage}/manage/site/dic?code=activity`,
getKindList: `GET ${services.webManage}/tpClassification/list`,
saveKind: `POST ${services.webManage}/tpClassification/save`,
deleteKind: `POST ${services.webManage}/tpClassification/delete`,
......
......@@ -5,6 +5,7 @@ const initialState = {
aclist: "",
planlist: [],
trainkindlist: "",
activityList: "",
qcodelist: "",
trainfirstinfo: {},
plansetting: "",
......@@ -33,6 +34,10 @@ function train(state = initialState, action) {
return Object.assign({}, state, {
trainkindlist: action.data,
});
case "GET_ACTIVITY_LIST":
return Object.assign({}, state, {
activityList: action.data,
});
// 培训项目计划列表
case "GET_TRAIN_PLAN_LIST":
return Object.assign({}, state, {
......@@ -60,7 +65,6 @@ function train(state = initialState, action) {
});
// 取得培训项目第一步信息
case "GET_TRAIN_FIRST":
return Object.assign({}, state, {
trainfirstinfo: action.data,
});
......
......@@ -487,14 +487,24 @@ class Readover extends Component {
</a>
<div>
{(item.fileUrl &&
item.fileUrl.substring(item.fileUrl.length - 3) ===
"mp4") ||
item.fileUrl.substring(
item.fileUrl.length - 3
) === "mp4") ||
(item.fileUrl &&
item.fileUrl.substring(item.fileUrl.length - 3) ===
"MP4") ? (
<video src={item.fileUrl} controls="controls" preload style={{width:"300px"}} />
item.fileUrl.substring(
item.fileUrl.length - 3
) === "MP4") ? (
<video
src={item.fileUrl}
controls="controls"
preload
style={{ width: "300px" }}
/>
) : (
<img src={item.fileUrl} style={{width:"300px"}} />
<img
src={item.fileUrl}
style={{ width: "300px" }}
/>
)}
</div>
</div>
......
import { createFromIconfontCN } from '@ant-design/icons';
import { createFromIconfontCN } from "@ant-design/icons";
const IconFont = createFromIconfontCN({
scriptUrl: 'https://at.alicdn.com/t/font_1101588_01zniftxm9yp.js',
scriptUrl: "https://at.alicdn.com/t/font_1101588_01zniftxm9yp.js",
});
export default IconFont;
......@@ -55,6 +55,7 @@ import sensitiveWords from "@/pages/SystemManagement/SensitiveWords/redux/reduce
import singleSite from "@/pages/SystemManagement/Site/SiteManger/compontents/redux/singleSiteReducer"; //站点管理
import roteMange from "@/pages/SystemManagement/Site/SiteManger/compontents/redux/roteReducer";
import information from "@/pages/SystemManagement/Information/redux/reducer"; //资讯管理
import article from "@/pages/SystemManagement/Article/redux/reducer"; //资讯管理
import courseSale from "@/pages/SystemManagement/ResourceAuth/redux/reducer";
import departmentTree from "@/pages/SystemManagement/Organization/redux/reducer"; //用户管理
import accountGroup from "@/pages/SystemManagement/userGroup/redux/reducer"; //管辖区管理
......@@ -64,7 +65,7 @@ import wechatConfig from "@/pages/Operating/WechatConfig/redux/reducer";
//语言
import languageConfiguration from "@/pages/Operating/LanguageConfiguration/redux/reducer";
//换肤管理
import changeSkin from '@/pages/SystemManagement/Site/ChangeSkin/redux/reducer';
import changeSkin from "@/pages/SystemManagement/Site/ChangeSkin/redux/reducer";
//站点维护
import siteMaintain from "@/pages/Operating/SiteMaintain/redux/reducer";
//菜单管理
......@@ -76,7 +77,6 @@ import smartPractice from "@/pages/TrainingTools/smartPractice/redux/reducer";
//请求日志
import requestLog from "@/pages/SystemManagement/requrestLog/redux/reducer";
const app = combineReducers({
uploadParam,
login, // 登录
......@@ -124,6 +124,7 @@ const app = combineReducers({
singleSite,
roteMange,
information,
article,
courseSale,
departmentTree,
accountGroup,
......@@ -135,7 +136,7 @@ const app = combineReducers({
siteMaintain,
menuManager,
smartPractice,
requestLog
requestLog,
});
export default app;
......@@ -5,8 +5,9 @@ let baseUrl = "";
if (location.host.includes("localhost")) {
// baseUrl = IP + '/admin';
// baseUrl = "http://10.23.1.180:8090";
baseUrl = "http://192.168.1.106:8090";
baseUrl = "http://10.23.1.180:8090";
// baseUrl = "http://192.168.1.107:8090";
// baseUrl = "http://192.168.1.106:8090";
}
const service = {
......
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