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 React from "react";
import {
Row,
Col,
Tree,
Form,
Modal,
Input,
Select,
Steps,
Icon,
Table,
Button,
message,
} from "antd";
import Head from "./head";
import func from "@/common/commonFunc";
import Breadcrumb from "@/common/Breadcrumb";
import AddEditForm from "./addEditForm";
import { connect } from "react-redux";
import {
postReleases,
postUnReleases,
// postInsert,
postUpdata,
getApprove,
getUnapprove,
getSeeEdit,
getSearch,
getList,
menu,
} from "./redux/action";
import moment from "moment";
import Styles from "./style.less";
const TreeNode = Tree.TreeNode;
const FormItem = Form.Item;
const Option = Select.Option;
const { TextArea } = Input;
class Atricle extends React.Component {
constructor(props) {
super(props);
this.state = {
page: 1,
pagesize: 20,
record: [],
total: 0,
visible: false,
editor: "",
type: "",
title: "",
keyValue: 1,
menuList: [],
inputValue: {
state: "",
number: "",
},
};
}
componentDidMount() {
const { page, pagesize } = this.state;
let _this = this;
this.props.getList(
{
pageNo: page,
pageSize: pagesize,
},
() => {
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
});
}
);
this.props.menu({ id: 2 }, () => {
_this.setState({
menuList: _this.props.menuList,
});
});
}
//Table 分页
pageChange = (page, pagesize) => {
let _this = this;
const { inputValue } = this.state;
const { getList } = this.props;
getList(
{
pageNo: page,
pageSize: pagesize,
...inputValue,
},
() => {
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
});
}
);
this.setState({ page: page, pagesize: pagesize });
if (pagesize != this.state.pagesize) {
this.setState({ page: 1, pagesize: pagesize }, () => {
getList({
pageNo: 1,
pageSize: pagesize,
...inputValue,
});
});
}
};
getStatus(status) {
switch (status) {
case 0:
return "删除";
break;
case 1:
return "草稿";
break;
case 2:
return "待审核";
break;
case 3:
return "待发布";
break;
case 4:
return "已发布";
break;
case 5:
return "不通过";
break;
default:
return "";
break;
}
}
//搜索
headForm = value => {
let _this = this;
const { getList } = this.props;
const { page, pagesize } = this.state;
getList(
_this.filterParams({
pageNo: 1,
pageSize: pagesize,
number: value.number,
state: value.state,
typeId: value.typeId,
author: value.author,
fileName: value.fileName,
start: value.time ? value.time[0] : "",
end: value.time ? value.time[1] : "",
}),
() => {
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
page: 1,
inputValue: {
state: value.state,
number: value.number,
typeId: value.typeId,
author: value.author,
fileName: value.fileName,
start: value.time ? value.time[0] : "",
end: value.time ? value.time[1] : "",
},
});
}
);
};
//查看 编辑
seeEdit(record, type) {
let _this = this;
this.props.getSeeEdit({ id: record }, res => {
_this.setState({ keyValue: Math.random() });
this.setState({ visible: true, type: type });
});
}
handleCancel = () => {
this.setState({ visible: false });
};
filterParams(params) {
for (let key in params) {
if (
params[key] === "" ||
params[key] === null ||
params[key] === undefined
) {
delete params[key];
}
}
return params;
}
//审核
approve = (id, type) => {
let _this = this;
const { page, pagesize, inputValue } = this.state;
const { getApprove, getUnapprove, getList } = this.props;
if (type == 1) {
//通过
getApprove({ id }, () => {
getList(
_this.filterParams({
pageNo: page,
pageSize: pagesize,
...inputValue,
}),
() => {
message.success("审核通过成功");
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
visible: false,
});
}
);
});
} else {
//不通过
getUnapprove({ id }, () => {
getList(
_this.filterParams({
pageNo: page,
pageSize: pagesize,
...inputValue,
}),
() => {
message.success("审核不通过成功");
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
visible: false,
});
}
);
});
}
};
//发布
shelves = (id, type) => {
let _this = this;
const { page, pagesize, inputValue } = this.state;
const { postReleases, postUnReleases, getList } = this.props;
if (type == 1) {
//发布
postReleases({ ids: [id] }, () => {
getList(
_this.filterParams({
pageNo: page,
pageSize: pagesize,
...inputValue,
}),
() => {
message.success("发布成功");
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
});
}
);
});
} else {
//取消发布
postUnReleases({ ids: [id] }, () => {
getList(
_this.filterParams({
pageNo: page,
pageSize: pagesize,
...inputValue,
}),
() => {
message.success("取消发布成功");
_this.setState({
record: _this.props.tableList,
total: _this.props.tableList.total,
});
}
);
});
}
};
//编辑
handleCreate = (id, pdfOssUrl, pdfFileName) => {
let _this = this;
const form = this.formRef.props.form;
const { page, pagesize, inputValue } = this.state;
const { postUpdata, getList } = this.props;
form.validateFields((err, values) => {
if (err) {
return;
}
const jsonEdit = {
id,
fileName: values.fileName.trim(),
content: _this.state.editor,
author: values.author,
deptName: values.deptName,
pdfOssUrl: pdfOssUrl,
pdfFileName: pdfFileName,
};
postUpdata(_this.filterParams(jsonEdit), () => {
// reset
getList(
_this.filterParams({
pageNo: page,
pageSize: pagesize,
...inputValue,
}),
() => {
message.success("修改成功");
_this.setState({ record: _this.props.tableList });
}
);
});
this.setState({ visible: false });
});
};
//富文本
onEditor = editor => {
this.setState({ editor });
};
saveFormRef = formRef => {
this.formRef = formRef;
};
render() {
const columns = [
{
title: "序号",
dataIndex: "key",
key: "key",
render: (text, record, index) => (
<span>{this.state.pagesize * (this.state.page - 1) + index + 1}</span>
),
},
{
title: "投稿id",
dataIndex: "number",
key: "number",
render: text => {
return <span title={text}>{text}</span>;
},
},
{
title: "投稿类型",
dataIndex: "typeId",
key: "typeId",
render: (text, record) => {
return (
<span>
{record.typeOneName}/{record.typeTwoName}/{record.typeThreeName}
</span>
);
},
},
{
title: "作者",
dataIndex: "author",
key: "author",
render: text => {
return <span title={text}>{text}</span>;
},
},
{
title: "支部或部室",
dataIndex: "deptName",
key: "deptName",
render: text => {
return <span title={text}>{text}</span>;
},
},
{
title: "投稿时间",
dataIndex: "submitTime",
key: "submitTime",
render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>,
},
{
title: "投稿标题",
dataIndex: "fileName",
key: "fileName",
render: text => {
return (
<span title={text}>
{text.length > 10 ? text.substring(9, 0) + "..." : text}
</span>
);
},
},
{
title: "审核时间",
dataIndex: "approveTime",
key: "approveTime",
render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>,
},
{
title: "状态",
dataIndex: "state",
key: "state",
render: text => <span>{this.getStatus(text)}</span>,
},
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: "30%",
render: (text, record) => {
return (
<div>
{record.state == "2" && (
<div style={{ display: "inline" }}>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "审核" });
this.seeEdit(record.id, "approve");
}}
>
审核
</a>
</div>
)}
{record.state == "3" && (
<div style={{ display: "inline" }}>
<a
className={Styles.marr10}
onClick={() => this.shelves(record.id, 1)}
>
发布
</a>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "编辑" });
this.seeEdit(record.id, "edit");
}}
>
编辑
</a>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "查看" });
this.seeEdit(record.id, "look");
}}
>
查看
</a>
</div>
)}
{record.state == "4" && (
<div style={{ display: "inline" }}>
<a
className={Styles.marr10}
onClick={() => this.shelves(record.id, 2)}
>
取消发布
</a>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "编辑" });
this.seeEdit(record.id, "edit");
}}
>
编辑
</a>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "查看" });
this.seeEdit(record.id, "look");
}}
>
查看
</a>
</div>
)}
{record.state == "5" && (
<div style={{ display: "inline" }}>
<a
className={Styles.marr10}
onClick={() => {
this.setState({ title: "查看" });
this.seeEdit(record.id, "look");
}}
>
查看
</a>
</div>
)}
</div>
);
},
},
];
let pagination = func.paginationConfig(this.pageChange);
pagination.total = this.state.total;
pagination.current = this.state.page;
return (
<div className={Styles.pmEditIcon}>
<Breadcrumb title="投稿管理" />
<Head headForm={this.headForm} menuList={this.state.menuList} />
<Table
dataSource={this.state.record.records}
columns={columns}
pagination={pagination}
rowKey={record => record.id}
/>
{this.state.visible && (
<AddEditForm
wrappedComponentRef={this.saveFormRef}
visible={this.state.visible}
type={this.state.type}
title={this.state.title}
keyValue={this.state.keyValue}
onCancel={this.handleCancel}
onCreate={this.handleCreate}
onEditor={this.onEditor}
onApprove={this.approve}
/>
)}
</div>
);
}
}
function mapStateToProps(state, ownProps) {
return {
tableList: state.article.tableList,
menuList: state.article.menuList,
};
}
function mapDispatchToProps(dispatch) {
return {
postReleases: (obj, callback) => dispatch(postReleases(obj, callback)),
postUnReleases: (obj, callback) => dispatch(postUnReleases(obj, callback)),
// postInsert: (obj, callback) => dispatch(postInsert(obj, callback)),
postUpdata: (obj, callback) => dispatch(postUpdata(obj, callback)),
postReleases: (obj, callback) => dispatch(postReleases(obj, callback)),
getUnapprove: (obj, callback) => dispatch(getUnapprove(obj, callback)),
getSearch: (obj, callback) => dispatch(getSearch(obj, callback)),
getList: (obj, callback) => dispatch(getList(obj, callback)),
getSeeEdit: (obj, callback) => dispatch(getSeeEdit(obj, callback)),
getApprove: (obj, callback) => dispatch(getApprove(obj, callback)),
menu: (obj, callback) => dispatch(menu(obj, callback)),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Atricle);
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) {
});
};
}
......@@ -13,7 +13,9 @@ import SpinLoading from "@/common/SpinLoading/index";
// //测验课程
const TaskLog = Loadable({
loader: () =>
import(/* webpackChunkName: "TaskLog" */ "@/pages/SystemManagement/TaskLog/"),
import(
/* webpackChunkName: "TaskLog" */ "@/pages/SystemManagement/TaskLog/"
),
loading: SpinLoading,
});
// //站点管理
......@@ -22,137 +24,191 @@ const TaskLog = Loadable({
// );
const Banner = Loadable({
loader: () =>
import(/* webpackChunkName: "Banner" */ "@/pages/SystemManagement/Banner/index"),
import(
/* webpackChunkName: "Banner" */ "@/pages/SystemManagement/Banner/index"
),
loading: SpinLoading,
});
//消息管理
const MessageManagement = Loadable({
loader: () =>
import(/* webpackChunkName: "MessageManagement" */ "@/pages/SystemManagement/MessageManagement/index"),
import(
/* webpackChunkName: "MessageManagement" */ "@/pages/SystemManagement/MessageManagement/index"
),
loading: SpinLoading,
});
//敏感词管理
const SensitiveWords = Loadable({
loader: () =>
import(/* webpackChunkName: "SensitiveWords" */ "@/pages/SystemManagement/SensitiveWords/index"),
import(
/* webpackChunkName: "SensitiveWords" */ "@/pages/SystemManagement/SensitiveWords/index"
),
loading: SpinLoading,
});
//站点管理
const SingleSiteManger = Loadable({
loader: () =>
import(/* webpackChunkName: "SingleSiteManger" */ "@/pages/SystemManagement/Site/SiteManger/compontents/singleSite"),
import(
/* webpackChunkName: "SingleSiteManger" */ "@/pages/SystemManagement/Site/SiteManger/compontents/singleSite"
),
loading: SpinLoading,
});
//子站点管理
const MoreSiteManger = Loadable({
loader: () =>
import(/* webpackChunkName: "MoreSiteManger" */ "@/pages/SystemManagement/Site/SiteManger/compontents/moreSite"),
import(
/* webpackChunkName: "MoreSiteManger" */ "@/pages/SystemManagement/Site/SiteManger/compontents/moreSite"
),
loading: SpinLoading,
});
//资讯管理
const Information = Loadable({
loader: () =>
import(/* webpackChunkName: "Information" */ "@/pages/SystemManagement/Information"),
import(
/* webpackChunkName: "Information" */ "@/pages/SystemManagement/Information"
),
loading: SpinLoading,
});
//投稿管理
const Article = Loadable({
loader: () =>
import(
/* webpackChunkName: "Information" */ "@/pages/SystemManagement/Article"
),
loading: SpinLoading,
});
//企业通讯录
const CompanyManagement = Loadable({
loader: () =>
import(/* webpackChunkName: "CompanyManagement" */ "@/pages/SystemManagement/companyManagement/companyManagement"),
import(
/* webpackChunkName: "CompanyManagement" */ "@/pages/SystemManagement/companyManagement/companyManagement"
),
loading: SpinLoading,
});
//角色管理
const RoteManager = Loadable({
loader: () =>
import(/* webpackChunkName: "RoteManager" */ "@/pages/SystemManagement/RoteManager/RoteManager"),
import(
/* webpackChunkName: "RoteManager" */ "@/pages/SystemManagement/RoteManager/RoteManager"
),
loading: SpinLoading,
});
const UserInfo = Loadable({
loader: () =>
import(/* webpackChunkName: "UserInfo" */ "@/pages/SystemManagement/Organization/AddUser/UserInfo"),
import(
/* webpackChunkName: "UserInfo" */ "@/pages/SystemManagement/Organization/AddUser/UserInfo"
),
loading: SpinLoading,
});
const FixUser = Loadable({
loader: () =>
import(/* webpackChunkName: "FixUser" */ "@/pages/SystemManagement/Organization/FixUser/index"),
import(
/* webpackChunkName: "FixUser" */ "@/pages/SystemManagement/Organization/FixUser/index"
),
loading: SpinLoading,
});
//资源授权管理
const ResourceAuth = Loadable({
loader: () =>
import(/* webpackChunkName: "ResourceAuth" */ "@/pages/SystemManagement/ResourceAuth/index"),
import(
/* webpackChunkName: "ResourceAuth" */ "@/pages/SystemManagement/ResourceAuth/index"
),
loading: SpinLoading,
});
//用户管理
const Organization = Loadable({
loader: () =>
import(/* webpackChunkName: "Organization" */ "@/pages/SystemManagement/Organization/Organization"),
import(
/* webpackChunkName: "Organization" */ "@/pages/SystemManagement/Organization/Organization"
),
loading: SpinLoading,
});
//管辖区管理
const UserGroup = Loadable({
loader: () =>
import(/* webpackChunkName: "UserGroup" */ "@/pages/SystemManagement/userGroup/userGroup"),
import(
/* webpackChunkName: "UserGroup" */ "@/pages/SystemManagement/userGroup/userGroup"
),
loading: SpinLoading,
});
//显示配置
const ShowSite = Loadable({
loader: () =>
import(/* webpackChunkName: "ShowSite" */ "@/pages/SystemManagement/Site/ShowSite/index"),
import(
/* webpackChunkName: "ShowSite" */ "@/pages/SystemManagement/Site/ShowSite/index"
),
loading: SpinLoading,
});
//积分设置
const CurrencyOption = Loadable({
loader: () =>
import(/* webpackChunkName: "CurrencyOption" */ "@/pages/SystemManagement/Point/CurrencyOption"),
import(
/* webpackChunkName: "CurrencyOption" */ "@/pages/SystemManagement/Point/CurrencyOption"
),
loading: SpinLoading,
});
//活动策略设置
const ActiveOption = Loadable({
loader: () =>
import(/* webpackChunkName: "ActiveOption" */ "@/pages/SystemManagement/Point/ActiveOption"),
import(
/* webpackChunkName: "ActiveOption" */ "@/pages/SystemManagement/Point/ActiveOption"
),
loading: SpinLoading,
});
//积分兑换设置
const ExchangeForOption = Loadable({
loader: () =>
import(/* webpackChunkName: "ExchangeForOption" */ "@/pages/SystemManagement/Point/exchangeForOption/index"),
import(
/* webpackChunkName: "ExchangeForOption" */ "@/pages/SystemManagement/Point/exchangeForOption/index"
),
loading: SpinLoading,
});
//积分流水明细
const Detailed = Loadable({
loader: () =>
import(/* webpackChunkName: "Detailed" */ "@/pages/SystemManagement/Point/Detailed"),
import(
/* webpackChunkName: "Detailed" */ "@/pages/SystemManagement/Point/Detailed"
),
loading: SpinLoading,
});
// RulesEngine 规则引擎(推荐管理)
const RulesEngine = Loadable({
loader: () =>
import(/* webpackChunkName: "RulesEngine" */ "@/pages/SystemManagement/RulesEngine/index"),
import(
/* webpackChunkName: "RulesEngine" */ "@/pages/SystemManagement/RulesEngine/index"
),
loading: SpinLoading,
});
const AddRulesBase = Loadable({
loader: () =>
import(/* webpackChunkName: "AddRulesBase" */ "@/pages/SystemManagement/RulesEngine/AddRulesEngine/AddRulesBase"),
import(
/* webpackChunkName: "AddRulesBase" */ "@/pages/SystemManagement/RulesEngine/AddRulesEngine/AddRulesBase"
),
loading: SpinLoading,
});
//用户规则
const UsersRolesRoles = Loadable({
loader: () =>
import(/* webpackChunkName: "UsersRolesRoles" */ "@/pages/SystemManagement/UsersRolesRoles/index"),
import(
/* webpackChunkName: "UsersRolesRoles" */ "@/pages/SystemManagement/UsersRolesRoles/index"
),
loading: SpinLoading,
});
//内容规则
const ContentRulesRules = Loadable({
loader: () =>
import(/* webpackChunkName: "ContentRulesRules" */ "@/pages/SystemManagement/ContentRulesRules/index"),
import(
/* webpackChunkName: "ContentRulesRules" */ "@/pages/SystemManagement/ContentRulesRules/index"
),
loading: SpinLoading,
});
//国际化配置
const InternationalConguration = Loadable({
loader: () =>
import(/* webpackChunkName: "InternationalConguration" */ "@/pages/SystemManagement/InternationalConguration"),
import(
/* webpackChunkName: "InternationalConguration" */ "@/pages/SystemManagement/InternationalConguration"
),
loading: SpinLoading,
});
//门户管理
......@@ -164,44 +220,58 @@ const Door = Loadable({
// 移动端首页预览
const PreviewIndexPage = Loadable({
loader: () =>
import(/* webpackChunkName: "PreviewIndexPage" */ "@/pages/SystemManagement/Site/Door/previewIndexPage"),
import(
/* webpackChunkName: "PreviewIndexPage" */ "@/pages/SystemManagement/Site/Door/previewIndexPage"
),
loading: SpinLoading,
});
//PC端首页预览
const PcIndex = Loadable({
loader: () =>
import(/* webpackChunkName: "PcIndex" */ "@/pages/SystemManagement/Site/Door/pcIndex"),
import(
/* webpackChunkName: "PcIndex" */ "@/pages/SystemManagement/Site/Door/pcIndex"
),
loading: SpinLoading,
});
//移动端配置首页
const IndexPage = Loadable({
loader: () =>
import(/* webpackChunkName: "IndexPage" */ "@/pages/SystemManagement/Site/Door/indexPage"),
import(
/* webpackChunkName: "IndexPage" */ "@/pages/SystemManagement/Site/Door/indexPage"
),
loading: SpinLoading,
});
//PC端配置登录页
const PcLogin = Loadable({
loader: () =>
import(/* webpackChunkName: "PcLogin" */ "@/pages/SystemManagement/Site/Door/pcLogin"),
import(
/* webpackChunkName: "PcLogin" */ "@/pages/SystemManagement/Site/Door/pcLogin"
),
loading: SpinLoading,
});
//移动端配置登录页
const LoginPage = Loadable({
loader: () =>
import(/* webpackChunkName: "LoginPage" */ "@/pages/SystemManagement/Site/Door/loginPage"),
import(
/* webpackChunkName: "LoginPage" */ "@/pages/SystemManagement/Site/Door/loginPage"
),
loading: SpinLoading,
});
//换肤设置
const ChangeSkin = Loadable({
loader: () =>
import(/* webpackChunkName: "ChangeSkin" */ "@/pages/SystemManagement/Site/ChangeSkin"),
import(
/* webpackChunkName: "ChangeSkin" */ "@/pages/SystemManagement/Site/ChangeSkin"
),
loading: SpinLoading,
});
//请求日志
const RequestLogList = Loadable({
loader: () =>
import(/* webpackChunkName: "ChangeSkin" */ "@/pages/SystemManagement/requrestLog"),
import(
/* webpackChunkName: "ChangeSkin" */ "@/pages/SystemManagement/requrestLog"
),
loading: SpinLoading,
});
......@@ -257,6 +327,11 @@ class Online extends React.Component {
path={`${this.props.match.url}/information-management`}
component={() => <Information />}
/>
{/*投稿管理*/}
<Route
path={`${this.props.match.url}/article-management`}
component={() => <Article />}
/>
<Route
path={`${this.props.match.url}/underline/underlineclass`}
......@@ -369,12 +444,12 @@ class Online extends React.Component {
path={`${this.props.match.url}/site/door/loginpage`}
component={() => <LoginPage props={{ ...this.props }} />}
/>
{/*换肤设置界面*/ }
{/*换肤设置界面*/}
<Route
path={`${this.props.match.url}/site/changeSkin`}
component={() => <ChangeSkin props={{ ...this.props }} />}
/>
{/*请求日志列表*/ }
{/*请求日志列表*/}
<Route
path={`${this.props.match.url}/request-log-list`}
component={() => <RequestLogList props={{ ...this.props }} />}
......
/**
* 新建项目基本信息表单
* 新建活动基本信息表单
*/
import React from "react";
import TagGroup from "../../../common/tags";
// import UpLoad from "../../../common/UpLoad";
// import LzEditor from "../../../common/editor/editor/index.jsx";
import moment from "moment";
import { Form, Input, Select, Col, DatePicker, Row } from "antd";
import {
Form,
Input,
Select,
Col,
DatePicker,
Row,
Upload,
Icon,
Modal,
} from "antd";
import validator from "../../../common/validatorForm/index";
import UploadImageCover from "../../../common/UploadImageCover";
import Editor from "../../../common/Editor/editor";
......@@ -23,11 +33,12 @@ class App extends React.Component {
value: 1,
description: "",
logourl: null,
activityUrl: null,
};
}
//培训项目列表
//培训活动列表
componentDidMount() {
// 培训项目列表
// 培训活动列表
this.props.onTrainKind();
}
......@@ -41,7 +52,7 @@ class App extends React.Component {
});
};
// 项目日期 获取
// 活动日期 获取
onChange(date, dateString) {
const startDate = dateString[0];
const endDate = dateString[1];
......@@ -66,18 +77,42 @@ class App extends React.Component {
});
};
activityUrl = imageUrl => {
this.props.form.setFieldsValue({
activityUrl: imageUrl,
});
this.props.activityUrl(imageUrl);
this.setState({
activityUrl: imageUrl,
});
};
render() {
const { getFieldDecorator } = this.props.form;
const {
previewVisible,
previewImage,
fileList,
uploadAction,
uploadParams,
} = this.state;
const uploadButton = (
<div>
<Icon type="plus" />
<div className="ant-upload-text">Upload</div>
</div>
);
const {
// receiveHtml,
// tags,
// logourl,
// onTrainKind,
trainkindlist,
activityList,
trainfirstinfo,
tpClassificationId,
} = this.props;
const { logourl } = this.state;
const { logourl, activityUrl } = this.state;
const that = this;
let usable = false;
......@@ -131,105 +166,64 @@ class App extends React.Component {
},
};
}
const uploadPropsNew = {
required: true,
name: "项目Logo:",
extra: "图片最佳尺寸:1125*675,支持jpg、png、jpeg", //task-1110-cwj 删除500k
layout: {
labelCol: { span: 4 },
wrapperCol: { span: 11 },
},
defaultUrl: [],
getUrl: url => {
that.props.logourl(url);
},
};
const uploadPropsEdite = {
required: true,
usable: false,
extra: "图片最佳尺寸:1125*675,支持jpg、png、jpeg", //task-1110-cwj 删除500k
name: "项目Logo:",
layout: {
labelCol: { span: 4 },
wrapperCol: { span: 11 },
},
defaultUrl: trainfirstinfo.logoImg
? [
{
uid: 1,
status: "done",
reponse: "Server Error 500",
url: trainfirstinfo.logoImg,
},
]
: [],
getUrl: url => {
that.props.logourl(url);
},
};
const uploadPropsSee = {
required: true,
usable: true,
extra: "图片最佳尺寸:1125*675,支持jpg、png、jpeg", //task-1110-cwj 删除500k
name: "项目Logo:",
layout: {
labelCol: { span: 4 },
wrapperCol: { span: 11 },
},
defaultUrl: trainfirstinfo.logoImg
? [
{
uid: 1,
status: "done",
reponse: "Server Error 500",
url: trainfirstinfo.logoImg,
},
]
: [],
getUrl: url => {
this.setState({
logourl: url,
});
},
};
console.log("333333333333", trainfirstinfo);
// debugger
return (
<div style={{ textAlign: "left" }}>
<Form onSubmit={this.handleSubmit}>
{/* 项目名称 */}
<FormItem {...formItemLayout} label="项目名称">
{/* 活动名称 */}
<FormItem {...formItemLayout} label="活动名称">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("name", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.name : "", //bug-11153-liyuan 修改新增项目会出现缓存名称和时间
trainfirstinfo !== "" ? trainfirstinfo.name : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: true,
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入项目名称", 50);
validator(rule, value, callback, "请输入活动名称", 50);
},
},
],
})(<Input placeholder="未命名的学习项目" disabled={usable} />)}
})(<Input placeholder="未命名的学习活动" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有项目</Button>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
</Form>
{/* 项目Logo */}
{/* {(this.props.infoTitle === "新建信息"||this.props.infoTitle === "修改信息") && ( */}
{/* <UpLoad {...uploadPropsNew} ref={c => (this.validate = c)} /> */}
<Form>
<FormItem {...formItemLayout} label="项目Logo:">
{/* 副标题 */}
<FormItem {...formItemLayout} label="副标题">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("subtitle", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.subtitle : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入副标题", 50);
},
},
],
})(<Input placeholder="请输入副标题" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
{/* 活动Logo */}
{/* {(this.props.infoTitle === "新建信息"||this.props.infoTitle === "修改信息") && ( */}
{/* <UpLoad {...uploadPropsNew} ref={c => (this.validate = c)} /> */}
<FormItem {...formItemLayout} label="活动Logo:">
{getFieldDecorator("logo", {
rules: [
{
required: true,
message: "项目Logo",
message: "活动Logo",
},
],
initialValue:
......@@ -237,7 +231,9 @@ class App extends React.Component {
})(
<UploadImageCover
details={(trainfirstinfo && trainfirstinfo.logoImg) || logourl}
importImage={(trainfirstinfo && trainfirstinfo.logoImg) || logourl}
importImage={
(trainfirstinfo && trainfirstinfo.logoImg) || logourl
}
getImgUrl={this.getImgUrl}
preRatio={["5/3"]}
maxSize={500}
......@@ -246,22 +242,41 @@ class App extends React.Component {
/>
)}
</FormItem>
</Form>
{/* )} */}
<FormItem {...formItemLayout} label="图片来源">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("pictureSource", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.pictureSource : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入图片来源", 50);
},
},
],
})(<Input placeholder="请输入图片来源" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
{/* )} */}
{/* {this.props.infoTitle === "查看信息" &&
{/* {this.props.infoTitle === "查看信息" &&
trainfirstinfo !== undefined && (
<UpLoad {...uploadPropsSee} ref={c => (this.validate = c)} />
)} */}
{/* {this.props.infoTitle === "修改信息" &&
{/* {this.props.infoTitle === "修改信息" &&
trainfirstinfo.logoImg && (
<UpLoad {...uploadPropsEdite} ref={c => (this.validate = c)} />
)} */}
<Form>
{/* 项目分类 */}
{/* 活动分类 */}
{(this.props.infoTitle === "新建信息" && (
<FormItem {...formItemLayout} label="项目分类">
<FormItem {...formItemLayout} label="活动分类">
<Col span={12}>
{getFieldDecorator("tpClassificationId", {
initialValue:
......@@ -274,7 +289,7 @@ class App extends React.Component {
{ required: false, message: "Please select your gender!" },
],
})(
<Select placeholder="请选择项目的分类" disabled={usable}>
<Select placeholder="请选择活动的分类" disabled={usable}>
{trainkindlist !== ""
? trainkindlist.map(d => (
<Option key={d.id}>{d.name}</Option>
......@@ -286,7 +301,7 @@ class App extends React.Component {
</FormItem>
)) ||
(this.props.infoTitle !== "新建信息" && (
<FormItem {...formItemLayout} label="项目分类">
<FormItem {...formItemLayout} label="活动分类">
<Col span={12}>
{getFieldDecorator("tpClassificationId", {
initialValue:
......@@ -301,7 +316,7 @@ class App extends React.Component {
},
],
})(
<Select placeholder="请选择项目的分类" disabled={usable}>
<Select placeholder="请选择活动的分类" disabled={usable}>
{trainkindlist !== ""
? trainkindlist.map(d => (
<Option key={d.id}>{d.name}</Option>
......@@ -313,10 +328,10 @@ class App extends React.Component {
</FormItem>
))}
{(this.props.infoTitle === "新建信息" && (
<FormItem label="项目时间" {...timeLayout}>
<FormItem label="活动时间" {...timeLayout}>
{getFieldDecorator("time", {
rules: [
{ type: "array", required: true, message: "请选择时间" },
{ type: "array", required: false, message: "请选择时间" },
],
initialValue: "",
})(
......@@ -326,31 +341,29 @@ class App extends React.Component {
format="YYYY-MM-DD HH:mm"
showTime={{ defaultValue: moment("00:00", "HH:mm") }}
dateRender={current => {
const style = {};
if (current.date() === 1) {
style.border = '1px solid #1890ff';
style.borderRadius = '50%';
style.border = "1px solid #1890ff";
style.borderRadius = "50%";
}
return (
<div className="ant-calendar-date" style={style}>
{current.date()}
</div>
);
}}
/>
)}
</FormItem>
)) ||
(this.props.infoTitle !== "新建信息" && (
<FormItem label="项目时间" {...timeLayout}>
<FormItem label="活动时间" {...timeLayout}>
{getFieldDecorator("time", {
rules: [
{ type: "array", required: true, message: "请选择时间" },
{ type: "array", required: false, message: "请选择时间" },
],
initialValue:
trainfirstinfo !== "" //bug-11153-liyuan 修改新增项目会出现缓存名称和时间
trainfirstinfo !== "" //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
? [
moment(trainfirstinfo.startTime),
moment(trainfirstinfo.endTime),
......@@ -362,24 +375,209 @@ class App extends React.Component {
format="YYYY-MM-DD HH:mm"
onChange={this.onChange.bind(this)}
showTime={{ defaultValue: moment("00:00", "HH:mm") }}
dateRender={current => {
const style = {};
if (current.date() === 1) {
style.border = '1px solid #1890ff';
style.borderRadius = '50%';
}
return (
<div className="ant-calendar-date" style={style}>
{current.date()}
</div>
);
}}
dateRender={current => {
const style = {};
if (current.date() === 1) {
style.border = "1px solid #1890ff";
style.borderRadius = "50%";
}
return (
<div className="ant-calendar-date" style={style}>
{current.date()}
</div>
);
}}
/>
)}
</FormItem>
))}
<FormItem {...formItemLayout} label="活动地址">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("activityAddress", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.activityAddress : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入活动地址", 50);
},
},
],
})(<Input placeholder="请输入活动地址" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="上传视频地址">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("videoUrl", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.videoUrl : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(
rule,
value,
callback,
"请输入上传视频地址",
50
);
},
},
],
})(
<Input placeholder="请输入上传视频地址" disabled={usable} />
)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="组织方">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("organizer", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.organizer : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入组织方", 50);
},
},
],
})(<Input placeholder="请输入组织方" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="协办方">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("coOrganizer", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.coOrganizer : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入协办方", 50);
},
},
],
})(<Input placeholder="请输入协办方" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="温馨提示">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("tips", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.tips : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入温馨提示", 50);
},
},
],
})(<Input placeholder="请输入温馨提示" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="其他提示">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("other", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.other : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入其他提示", 50);
},
},
],
})(<Input placeholder="请输入协办方" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem {...formItemLayout} label="活动奖励">
<Row gutter={12}>
<Col span={16}>
{getFieldDecorator("activityReward", {
initialValue:
trainfirstinfo !== "" ? trainfirstinfo.activityReward : "", //bug-11153-liyuan 修改新增活动会出现缓存名称和时间
rules: [
{
required: false,
validator: (rule, value, callback) => {
validator(rule, value, callback, "请输入活动奖励", 50);
},
},
],
})(<Input placeholder="请输入活动奖励" disabled={usable} />)}
</Col>
{/*<Col span={6}>
<Button size="small" disabled={usable} >复制已有活动</Button>
</Col>*/}
</Row>
</FormItem>
<FormItem label="奖励详情" {...formItemLayout}>
{getFieldDecorator("activityUrl", {
rules: [
{
required: false,
message: "奖励详情",
},
],
initialValue:
(trainfirstinfo.detailsImage.length > 0 &&
trainfirstinfo.detailsImage[0]?.img) ||
activityUrl,
})(
<UploadImageCover
details={
(trainfirstinfo.detailsImage.length > 0 &&
trainfirstinfo.detailsImage[0]?.img) ||
activityUrl
}
importImage={
(trainfirstinfo.detailsImage.length > 0 &&
trainfirstinfo.detailsImage[0]?.img) ||
activityUrl
}
getImgUrl={this.activityUrl}
preRatio={["5/3"]}
maxSize={500}
disabled={this.props.infoTitle === "查看信息" ? true : false}
extra="图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg" //task-1110-cwj 删除500k
/>
)}
</FormItem>
{/* 自定义关键词 */}
<FormItem
label="自定义关键词:"
......@@ -398,10 +596,10 @@ class App extends React.Component {
)}
</FormItem>
{/* 项目介绍 */}
{/* 活动介绍 */}
{this.props.infoTitle === "新建信息" && (
<FormItem
label="项目介绍:"
label="活动介绍:"
labelCol={{ span: 4 }}
wrapperCol={{ span: 19 }}
>
......@@ -418,7 +616,7 @@ class App extends React.Component {
{this.props.infoTitle === "查看信息" && (
<FormItem
label="项目介绍:"
label="活动介绍:"
labelCol={{ span: 4 }}
wrapperCol={{ span: 19 }}
>
......@@ -437,7 +635,7 @@ class App extends React.Component {
)}
{this.props.infoTitle === "修改信息" && (
<FormItem
label="项目介绍:"
label="活动介绍:"
labelCol={{ span: 4 }}
wrapperCol={{ span: 19 }}
>
......@@ -446,10 +644,10 @@ class App extends React.Component {
rules: [{ required: false }],
})(
<div>
<Editor
cbReceiver={this.props.receiveHtml}
importContent={trainfirstinfo.description}
/>
<Editor
cbReceiver={this.props.receiveHtml}
importContent={trainfirstinfo.description}
/>
</div>
)}
</FormItem>
......
......@@ -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);
......@@ -64,7 +64,7 @@ import validator from "../../../common/validatorForm/index";
import LinkUser from "../../../common/LinkUsers/linkUser";
import Task from "../../../common/task/Task";
import SettingPayInList from "./settingPayInList"
import SettingPayInList from "./settingPayInList";
import NewEnrollForm from "./NewEnrollForm.jsx";
import EnrollManag from "./EnrollManag.jsx";
......@@ -91,13 +91,13 @@ const Step = Steps.Step;
const steps = [
{
title: "项目基本信息",
title: "活动基本信息",
},
{
title: "添加学习计划",
title: "投票",
},
{
title: "设置项目规则",
title: "设置活动规则",
},
{
title: "发布",
......@@ -118,8 +118,6 @@ class TreeItem extends Component {
traniData: [], //bug-11153-liyuan 每次系统发版后,部分项目的可见范围名单会改变,变成其他项目的可见范围名单
newOrEdit: false, //bug-11153-liyuan false 为新建项目 true为修改项目
};
this.mouseEnter = this.mouseEnter.bind(this);
this.mouseLeave = this.mouseLeave.bind(this);
......@@ -164,7 +162,7 @@ class TreeItem extends Component {
}
});
},
onCancel() { },
onCancel() {},
});
} else {
that.props.onTrainKindDelete(param, (code, msg) => {
......@@ -217,7 +215,7 @@ class TreeItem extends Component {
this.setState({ none: true });
return;
}
// if(data.key!== '项目分类'){
// if(data.key!== '活动分类'){
if (data.stateKey !== true) {
this.setState({ show: true });
} else {
......@@ -230,7 +228,7 @@ class TreeItem extends Component {
this.setState({ none: false });
return;
}
// if(data.key!== '项目分类'){
// if(data.key!== '活动分类'){
if (data.stateKey !== true) {
this.setState({ show: false });
} else {
......@@ -337,7 +335,7 @@ class TreeItem extends Component {
reRrainlist() {
const { data, page, pageSize } = this.props;
const id = data.id;
if (data.key === "项目分类" && data.stateKey === true && pageSize) {
if (data.key === "活动分类" && data.stateKey === true && pageSize) {
this.props.reRrainlist({
pageNo: 1,
pageSize: pageSize,
......@@ -355,7 +353,6 @@ class TreeItem extends Component {
}
}
render() {
const { data, pageSize, page } = this.props;
const { show, visible, name, defaultValue, addshow } = this.state;
......@@ -372,7 +369,7 @@ class TreeItem extends Component {
};
return (
<div>
<Breadcrumb title="项目管理" />
<Breadcrumb title="活动管理" />
<Modal
className="sort-modal"
visible={visible}
......@@ -422,9 +419,7 @@ class TreeItem extends Component {
onClick={this.reRrainlist}
style={{ width: "100%", overflow: "hidden" }}
>
<span className={styles.itemTitle}>
{data.key}
</span>
<span className={styles.itemTitle}>{data.key}</span>
{(show && (
<span style={{ float: "right" }}>
<Icon
......@@ -481,6 +476,7 @@ class NewTP extends Component {
tags: [],
//图片地址
logourl: "",
activityUrl: "",
//富文本描述
description: "",
//报名标志
......@@ -522,7 +518,7 @@ class NewTP extends Component {
isPayTrain: false,
enrollOriginalPrice: 1,
showInList: 1,
type: null
type: null,
};
// 报名显示
this.onShowEnrollOption = this.showEnrollOption.bind(this);
......@@ -574,6 +570,7 @@ class NewTP extends Component {
this.tags = this.tags.bind(this);
// 图片logo
this.logourl = this.logourl.bind(this);
this.activityUrl = this.activityUrl.bind(this);
// 图片logo
this.enableEnroll = this.enableEnroll.bind(this);
// 图片logo
......@@ -612,11 +609,11 @@ class NewTP extends Component {
this.props.onTrainKind();
}
getEnrollOriginalPrice = (price) => {
getEnrollOriginalPrice = price => {
this.setState({
enrollOriginalPrice: price
})
}
enrollOriginalPrice: price,
});
};
//获取培训项目列表
getList() {
......@@ -627,7 +624,7 @@ class NewTP extends Component {
pageNo: page,
pageSize: pageSize,
status: status,
enrollStatus: type
enrollStatus: type,
});
} else {
this.props.onGetList({
......@@ -661,7 +658,7 @@ class NewTP extends Component {
});
};
//获取新增或编辑的分类
getSortData(obj) { }
getSortData(obj) {}
//table相关查询
//头部查询
......@@ -672,11 +669,11 @@ class NewTP extends Component {
});
}
//获取筛选条件
handleGetType = (value) => {
handleGetType = value => {
this.setState({
type: value ? parseInt(value) : null,
});
}
};
//获取输入框的值
handleGetValue(e) {
this.setState({
......@@ -704,7 +701,7 @@ class NewTP extends Component {
pageSize: pageSize,
status: status,
name: value,
enrollStatus: type
enrollStatus: type,
});
} else {
this.props.onGetList({
......@@ -713,7 +710,7 @@ class NewTP extends Component {
status: status,
tpClassificationId: tpClassificationId,
name: value,
enrollStatus: type
enrollStatus: type,
});
}
}
......@@ -797,7 +794,6 @@ class NewTP extends Component {
url: exportSignRecord,
data,
}).then(res => {
if (res.code === "1000") {
message.success(res.data);
} else {
......@@ -805,9 +801,9 @@ class NewTP extends Component {
}
});
};
// 导出活动清单
// 导出项目清单
downActivityTxt = record => {
console.log("活动", record);
console.log("项目", record);
let data = {
tpId: record,
};
......@@ -815,7 +811,6 @@ class NewTP extends Component {
url: activitiesExport,
data,
}).then(res => {
if (res.code === "1000") {
message.success(res.data);
} else {
......@@ -841,7 +836,7 @@ class NewTP extends Component {
var initHeight = canvas1.height;
var imageData = context.getImageData(0, 0, initWidth, initHeight);
var canvas2 = document.createElement('canvas');
var canvas2 = document.createElement("canvas");
canvas2.id = qcodelist[i].signTimeIds + new Date().getTime();
var context2 = canvas2.getContext("2d");
var img = document.getElementById("miniCode");
......@@ -858,17 +853,49 @@ class NewTP extends Component {
// 设置垂直对齐方式
context2.textBaseline = "middle";
// 绘制文字(参数:要写的字,x坐标,y坐标)
context2.fillText("邀请码:" + qcodelist[i].info.signTimeId.code, canvas2.width / 2, initHeight + 30);
zip.file(trainName + "(" + qcodelist[i].startTime + "~" + qcodelist[i].endTime + ")" + qcodelist[i].info.signTimeId.address + "_" + qcodelist[i].info.signTimeId.range + "米.png", canvas2.toDataURL("png").substring(22), { base64: true });
context2.fillText(
"邀请码:" + qcodelist[i].info.signTimeId.code,
canvas2.width / 2,
initHeight + 30
);
zip.file(
trainName +
"(" +
qcodelist[i].startTime +
"~" +
qcodelist[i].endTime +
")" +
qcodelist[i].info.signTimeId.address +
"_" +
qcodelist[i].info.signTimeId.range +
"米.png",
canvas2.toDataURL("png").substring(22),
{ base64: true }
);
} else {
zip.file(trainName + "(" + qcodelist[i].startTime + "~" + qcodelist[i].endTime + ")" + ".png", document.getElementById(qcodelist[i].signTimeIds).toDataURL("png").substring(22), { base64: true });
zip.file(
trainName +
"(" +
qcodelist[i].startTime +
"~" +
qcodelist[i].endTime +
")" +
".png",
document
.getElementById(qcodelist[i].signTimeIds)
.toDataURL("png")
.substring(22),
{ base64: true }
);
}
}
zip.generateAsync({ type: "blob" }).then(function (content) {
saveAs && saveAs(content, trainName + "(" + trainNameST + "~" + trainNameET + ")" + ".zip");
zip.generateAsync({ type: "blob" }).then(function(content) {
saveAs &&
saveAs(
content,
trainName + "(" + trainNameST + "~" + trainNameET + ")" + ".zip"
);
});
}
//table相关分页
//总条数
......@@ -892,7 +919,7 @@ class NewTP extends Component {
pageSize: pageSize,
status: status,
name: window._trainFlag === "1" ? "" : value,
enrollStatus: type
enrollStatus: type,
});
} else {
this.props.onGetList({
......@@ -902,7 +929,7 @@ class NewTP extends Component {
// name:value,
name: window._trainFlag === "1" ? "" : value,
tpClassificationId: tpClassificationId,
enrollStatus: type
enrollStatus: type,
});
}
}
......@@ -914,7 +941,7 @@ class NewTP extends Component {
pageNo: 1,
pageSize: size,
status: status,
enrollStatus: type
enrollStatus: type,
});
} else {
this.props.onGetList({
......@@ -922,7 +949,7 @@ class NewTP extends Component {
pageSize: size,
status: status,
tpClassificationId: tpClassificationId,
enrollStatus: type
enrollStatus: type,
});
}
this.state = {
......@@ -1094,7 +1121,10 @@ class NewTP extends Component {
}
// 报名开关
showEnrollOption = checked => {
this.setState({ enrollstatus: checked, refreshEnrollForm: new Date().getTime() });
this.setState({
enrollstatus: checked,
refreshEnrollForm: new Date().getTime(),
});
};
// 第一步相关设置
// 富文本介绍
......@@ -1115,6 +1145,12 @@ class NewTP extends Component {
logourl: url,
});
}
// 图片log
activityUrl(url) {
this.setState({
activityUrl: url,
});
}
// 签到是否开启
enableEnroll(checked) {
this.setState({
......@@ -1146,9 +1182,12 @@ class NewTP extends Component {
const current = this.state.current + 1;
this.setState({
current,
isPayTrain: String(trainfirstinfo.enableEnroll) == "0" ? false
: String(enrollinfolist.enablePay) == "1" ? true
: false
isPayTrain:
String(trainfirstinfo.enableEnroll) == "0"
? false
: String(enrollinfolist.enablePay) == "1"
? true
: false,
});
return;
}
......@@ -1202,9 +1241,25 @@ class NewTP extends Component {
} else {
description = this.state.description;
}
console.log(values);
const param = {
// 项目名字
name: values.name.trim(),
subtitle: values.subtitle,
detailsImage: [
{
id: parseFloat(Math.random()).toFixed(6) * 1000000,
img: values.activityUrl,
},
],
pictureSource: values.pictureSource,
activityAddress: values.activityAddress,
organizer: values.organizer,
coOrganizer: values.coOrganizer,
tips: values.tips,
other: values.other,
activityReward: values.activityReward,
videoUrl: values.videoUrl,
// logo地址
logoImg: values.logo,
// 分类
......@@ -1256,7 +1311,12 @@ class NewTP extends Component {
moment(values.time[1]).format("YYYY-MM-DD HH:mm:ss")
).getTime(),
// 是否需要审核,付费报名不需要审核
needAudit: parseInt(values.isPayForEnroll) == 1 ? 0 : values.needAudit ? 1 : 0,
needAudit:
parseInt(values.isPayForEnroll) == 1
? 0
: values.needAudit
? 1
: 0,
// 报名人数限制
personLimitNum: values.personLimitNum ? values.personLimitNum : 0,
// 报名须知
......@@ -1265,16 +1325,17 @@ class NewTP extends Component {
enablePay: parseInt(values.isPayForEnroll),
//购买实际价格 当enablePay=1时必填
actualPrice: parseInt(values.enrollPrice),
originalPrice: values.isShowOriginalPrice == "0" ? null : enrollOriginalPrice
originalPrice:
values.isShowOriginalPrice == "0" ? null : enrollOriginalPrice,
};
if (parseInt(values.isPayForEnroll) == 1) {
that.setState({
isPayTrain: true
isPayTrain: true,
});
} else {
that.setState({
isPayTrain: false
isPayTrain: false,
});
}
//
......@@ -1339,7 +1400,7 @@ class NewTP extends Component {
latitude: signdate[i].latitude,
longitude: signdate[i].longitude,//修复bug14704 byzhoujing
longitude: signdate[i].longitude, //修复bug14704 byzhoujing
point: signdate[i].point,
});
......@@ -1374,7 +1435,7 @@ class NewTP extends Component {
enableRemindNote: values.enableApp,
// 提醒说明
// "trainingProjectId": id,
enablePosition: this.state.signPosition ? "1" : "0"
enablePosition: this.state.signPosition ? "1" : "0",
};
//基本信息
this.props.onTrainFirstUpdate(param, (code, msg, id) => {
......@@ -1391,7 +1452,7 @@ class NewTP extends Component {
(code, msg, id) => {
if (code === "1000") {
// message.success("报名设置成功");
this.setState({ current: stepCurrnt + 1 });//报名信息必须更新成功才可以进入下一步
this.setState({ current: stepCurrnt + 1 }); //报名信息必须更新成功才可以进入下一步
} else if (code !== "1000") {
message.error("报名设置失败" + msg);
return;
......@@ -1403,7 +1464,7 @@ class NewTP extends Component {
{ trainingProjectId: id, ...enrollparam },
(code, msg, id) => {
if (code === "1000") {
this.setState({ current: stepCurrnt + 1 });//报名信息必须更新成功才可以进入下一步
this.setState({ current: stepCurrnt + 1 }); //报名信息必须更新成功才可以进入下一步
// message.success("报名修改成功");
} else if (code !== "1000") {
message.error("报名修改失败" + msg);
......@@ -1447,7 +1508,7 @@ class NewTP extends Component {
(code, msg, id) => {
if (code === "1000") {
// message.success("报名设置成功");
this.setState({ current: stepCurrnt + 1 });//报名信息必须更新成功才可以进入下一步
this.setState({ current: stepCurrnt + 1 }); //报名信息必须更新成功才可以进入下一步
} else if (code !== "1000") {
message.error("报名设置失败" + msg);
return;
......@@ -1460,7 +1521,7 @@ class NewTP extends Component {
(code, msg, id) => {
if (code === "1000") {
// message.success("报名修改成功");
this.setState({ current: stepCurrnt + 1 });//报名信息必须更新成功才可以进入下一步
this.setState({ current: stepCurrnt + 1 }); //报名信息必须更新成功才可以进入下一步
} else if (code !== "1000") {
message.error("报名修改失败" + msg);
return;
......@@ -1469,7 +1530,6 @@ class NewTP extends Component {
);
}
//下一步
} else if (code !== "1000") {
message.error("基本信息保存失败" + msg);
return;
......@@ -1478,9 +1538,8 @@ class NewTP extends Component {
}
});
} else {
that.setState({
isPayTrain: false
isPayTrain: false,
});
//签到
if (that.state.signstatus == true) {
......@@ -1660,6 +1719,21 @@ class NewTP extends Component {
const param = {
// 项目名字
name: values.name.trim(),
subtitle: values.subtitle,
detailsImage: [
{
id: parseFloat(Math.random()).toFixed(6) * 1000000,
img: values.activityUrl,
},
],
pictureSource: values.pictureSource,
activityAddress: values.activityAddress,
organizer: values.organizer,
coOrganizer: values.coOrganizer,
tips: values.tips,
other: values.other,
activityReward: values.activityReward,
videoUrl: values.videoUrl,
// logo地址
logoImg: this.state.logourl,
// 分类
......@@ -1679,7 +1753,7 @@ class NewTP extends Component {
//定位
enablePosition: this.state.signPosition ? 1 : 0,
};
this.setState({ paramInfo: param }, () => { });
this.setState({ paramInfo: param }, () => {});
//验证logo
if (this.state.logourl === "") {
message.error("请上传图片");
......@@ -1712,7 +1786,12 @@ class NewTP extends Component {
moment(values.time[1]).format("YYYY-MM-DD HH:mm:ss")
).getTime(),
// 是否需要审核
needAudit: parseInt(values.isPayForEnroll) == 1 ? 0 : values.needAudit ? 1 : 0,
needAudit:
parseInt(values.isPayForEnroll) == 1
? 0
: values.needAudit
? 1
: 0,
// 报名人数限制
personLimitNum: values.personLimitNum ? values.personLimitNum : 0,
// 报名须知
......@@ -1721,15 +1800,16 @@ class NewTP extends Component {
enablePay: parseInt(values.isPayForEnroll),
//购买实际价格 当enablePay=1时必填
actualPrice: parseInt(values.enrollPrice),
originalPrice: values.isShowOriginalPrice == "0" ? null : enrollOriginalPrice
originalPrice:
values.isShowOriginalPrice == "0" ? null : enrollOriginalPrice,
};
if (parseInt(values.isPayForEnroll) == 1) {
that.setState({
isPayTrain: true
isPayTrain: true,
});
} else {
that.setState({
isPayTrain: false
isPayTrain: false,
});
}
//
......@@ -1943,7 +2023,12 @@ class NewTP extends Component {
moment(values.time[1]).format("YYYY-MM-DD HH:mm:ss")
).getTime(),
// 是否需要审核
needAudit: parseInt(values.isPayForEnroll) == 1 ? 0 : values.needAudit ? 1 : 0,
needAudit:
parseInt(values.isPayForEnroll) == 1
? 0
: values.needAudit
? 1
: 0,
// 报名人数限制
personLimitNum: values.personLimitNum
? values.personLimitNum
......@@ -1954,15 +2039,18 @@ class NewTP extends Component {
enablePay: parseInt(values.isPayForEnroll),
//购买实际价格 当enablePay=1时必填
actualPrice: parseInt(values.enrollPrice),
originalPrice: values.isShowOriginalPrice == "0" ? null : enrollOriginalPrice
originalPrice:
values.isShowOriginalPrice == "0"
? null
: enrollOriginalPrice,
};
if (parseInt(values.isPayForEnroll) == 1) {
that.setState({
isPayTrain: true
isPayTrain: true,
});
} else {
that.setState({
isPayTrain: false
isPayTrain: false,
});
}
this.props.onEnrollInsert(enrollparam, (code, msg, id) => {
......@@ -1989,7 +2077,7 @@ class NewTP extends Component {
});
} else {
that.setState({
isPayTrain: false
isPayTrain: false,
});
//签到按钮打开
if (that.state.signstatus === true) {
......@@ -2014,11 +2102,13 @@ class NewTP extends Component {
signdate[i].dater1.format("YYYY-MM-DD HH:mm:ss"),
signdate[i].dater2.format("YYYY-MM-DD HH:mm:ss"),
]);
if (enablePosition && (!signdate[i].latitude || !signdate[i].longitude)) {
message.error("没有设置定位地址,请重新设置")
if (
enablePosition &&
(!signdate[i].latitude || !signdate[i].longitude)
) {
message.error("没有设置定位地址,请重新设置");
return;
}
}
}
let newl = Array.from(new Set(newArray));
......@@ -2385,7 +2475,7 @@ class NewTP extends Component {
remindVo.enableApp = messageRemindVo.type;
param = {
// 项目名字
// 项目名字项目
trainingProjectId: this.state.trainId,
point,
messageRemindVo,
......@@ -2553,17 +2643,17 @@ class NewTP extends Component {
id: array[i].id,
dater1: moment(
array[i].startTime +
" " +
array[i].startHour +
":" +
array[i].startMinute
" " +
array[i].startHour +
":" +
array[i].startMinute
),
dater2: moment(
array[i].endTime +
" " +
array[i].endHour +
":" +
array[i].endMinute
" " +
array[i].endHour +
":" +
array[i].endMinute
),
address: array[i].address,
latitude: array[i].latitude,
......@@ -2576,7 +2666,14 @@ class NewTP extends Component {
{ signId: signinfolist.id, signdate: trSignTimeVOs },
() => console.log("wwww", this.state)
);
this.setState({ signId: signinfolist.id, signdate: trSignTimeVOs, signPosition: signinfolist.enablePosition == "1" ? true : false }, () => console.log('wwww', this.state))
this.setState(
{
signId: signinfolist.id,
signdate: trSignTimeVOs,
signPosition: signinfolist.enablePosition == "1" ? true : false,
},
() => console.log("wwww", this.state)
);
// message.success("签到信息取得成功");
} else if (code !== "1000") {
message.error("签到信息取得失败" + msg);
......@@ -2594,7 +2691,7 @@ class NewTP extends Component {
this.props.onEnrollInfo(param, (code, msg) => {
if (code === "1000") {
_this.setState({
refreshEnrollForm: new Date().getTime()
refreshEnrollForm: new Date().getTime(),
});
// message.success("报名信息取得成功");
} else if (code !== "1000") {
......@@ -2826,11 +2923,11 @@ class NewTP extends Component {
});
};
changeShowInList = (value) => {
changeShowInList = value => {
this.setState({
showInList: value,
});
}
};
onSignPositionChange = evt => {
console.log("elainePosition########:", evt.target.value);
this.setState({
......@@ -2838,7 +2935,7 @@ class NewTP extends Component {
});
};
render() {
let data = [{ key: "项目分类" }];
let data = [{ key: "活动分类" }];
const text = (
<span>启用“报名”后,需要学员先报名,只有报名成功才能参与培训。</span>
);
......@@ -2847,6 +2944,7 @@ class NewTP extends Component {
const {
trainlist,
trainkindlist,
activityList,
resultcode,
insertStepViewRange,
qcodelist,
......@@ -2872,17 +2970,17 @@ class NewTP extends Component {
description: trainkindlist[i].description,
});
}
data = [{ key: "项目分类", stateKey: true, children }];
data = [{ key: "活动分类", stateKey: true, children }];
}
// 项目列表显示(如果未上架可以判断是否显示导出二维码)
const columns = [
{
title: "项目序号",
title: "活动序号",
dataIndex: "num",
key: "projectnumber",
},
{
title: "项目名称",
title: "活动名称",
dataIndex: "name",
key: "name",
render: (text, record, index) => {
......@@ -2909,7 +3007,7 @@ class NewTP extends Component {
},
},
{
title: "项目时间",
title: "活动时间",
dataIndex: "projectime",
key: "projectime",
render: (text, record, index) => {
......@@ -2985,29 +3083,29 @@ class NewTP extends Component {
</a>
</div>
) : (
<div>
<a
style={{ marginLeft: "10px", color: "#00CCFF" }}
onClick={() => this.onChangeTrainFirst(record)}
>
修改
<div>
<a
style={{ marginLeft: "10px", color: "#00CCFF" }}
onClick={() => this.onChangeTrainFirst(record)}
>
修改
</a>
<Popconfirm
title="确定要上架吗?"
okText="上架"
cancelText="取消"
onConfirm={() => this.onUp(record)}
>
<a style={{ marginLeft: "10px", color: "#00CCFF" }}>上架</a>
</Popconfirm>
<a
style={{ marginLeft: "10px", color: "#00CCFF" }}
onClick={() => this.showComment(record.id, record.name)}
>
评论管理
<Popconfirm
title="确定要上架吗?"
okText="上架"
cancelText="取消"
onConfirm={() => this.onUp(record)}
>
<a style={{ marginLeft: "10px", color: "#00CCFF" }}>上架</a>
</Popconfirm>
<a
style={{ marginLeft: "10px", color: "#00CCFF" }}
onClick={() => this.showComment(record.id, record.name)}
>
评论管理
</a>
</div>
)}
</div>
)}
<div>
<a
style={{ marginLeft: "10px", color: "#00CCFF" }}
......@@ -3054,8 +3152,8 @@ class NewTP extends Component {
</Popconfirm>
</div>
) : (
""
)}
""
)}
{record.sign === 1 ? (
<div>
<Popconfirm
......@@ -3070,8 +3168,8 @@ class NewTP extends Component {
</Popconfirm>
</div>
) : (
""
)}
""
)}
{record.enroll === 1 ? (
<div>
<a
......@@ -3082,8 +3180,8 @@ class NewTP extends Component {
</a>
</div>
) : (
""
)}
""
)}
<div>
<Popconfirm
......@@ -3093,7 +3191,7 @@ class NewTP extends Component {
onConfirm={() => this.downActivityTxt(record.id)}
>
<a style={{ marginLeft: "10px", color: "#00CCFF" }}>
导出活动清单
导出项目清单
</a>
</Popconfirm>
</div>
......@@ -3115,7 +3213,6 @@ class NewTP extends Component {
// 分类列表
const loop = data =>
data.map(item => {
if (item.children && item.children.length) {
return (
......@@ -3177,26 +3274,42 @@ class NewTP extends Component {
signTimeId: qcodelist[i].info.signTimeId.id,
// 项目Logo
type: "sign",
// 项目分类
// 活动分类
trainingProjectId: qcodelist[i].info.trainingProjectId,
signTimeIds: qcodelist[i].signTimeIds,
enablePosition: qcodelist[i].info.signTimeId.enablePosition,
code: qcodelist[i].info.signTimeId.enablePosition == "1" ? qcodelist[i].info.signTimeId.code : ""
code:
qcodelist[i].info.signTimeId.enablePosition == "1"
? qcodelist[i].info.signTimeId.code
: "",
});
}
qclist = newlist.map(
(d, index) => {
if (d.enablePosition == "1") {
//将小程序从个人版迁成企业版
return (<QRCode value={"https://open.weixin.qq.com/sns/getexpappinfo?appid=wx270fc674b6a906b0&amp;path=pages/invitation/invitation.html&from=singlemessage&isappinstalled=0#wechat-redirect"}
key={d.signTimeIds} id={d.signTimeIds} level="L" size={num} />)
} else {
return (<QRCode value={JSON.stringify(d)} key={d.signTimeIds} id={d.signTimeIds} level="L" size={num} />)
}
qclist = newlist.map((d, index) => {
if (d.enablePosition == "1") {
//将小程序从个人版迁成企业版
return (
<QRCode
value={
"https://open.weixin.qq.com/sns/getexpappinfo?appid=wx270fc674b6a906b0&amp;path=pages/invitation/invitation.html&from=singlemessage&isappinstalled=0#wechat-redirect"
}
key={d.signTimeIds}
id={d.signTimeIds}
level="L"
size={num}
/>
);
} else {
return (
<QRCode
value={JSON.stringify(d)}
key={d.signTimeIds}
id={d.signTimeIds}
level="L"
size={num}
/>
);
}
);
});
}
// Spin
......@@ -3222,7 +3335,7 @@ class NewTP extends Component {
</Col>
<Col span={19} style={{ paddingLeft: "16px" }}>
<div className={styles.filterDiv}>
项目状态:
活动状态:
<Select
defaultValue=""
style={{ width: 120, marginRight: 40 }}
......@@ -3271,28 +3384,28 @@ class NewTP extends Component {
{trainlist === null ? (
<span>'请添加项目'</span>
) : (
<div>
<Table
size="default"
dataSource={trainlist}
columns={columns}
loading={trainlist === null}
pagination={false}
/>
<Pagination
current={this.state.page}
className={styles.train_list_pagination}
size="small"
total={trainlist.length != 0 ? trainlist[0].total : 0}
showTotal={this.showTotal}
showSizeChanger
showQuickJumper
pageSizeOptions={["10", "20", "30", "40", "50"]}
onChange={this.handlePageChange}
onShowSizeChange={this.handlePageSizeChange}
/>
</div>
)}
<div>
<Table
size="default"
dataSource={trainlist}
columns={columns}
loading={trainlist === null}
pagination={false}
/>
<Pagination
current={this.state.page}
className={styles.train_list_pagination}
size="small"
total={trainlist.length != 0 ? trainlist[0].total : 0}
showTotal={this.showTotal}
showSizeChanger
showQuickJumper
pageSizeOptions={["10", "20", "30", "40", "50"]}
onChange={this.handlePageChange}
onShowSizeChange={this.handlePageSizeChange}
/>
</div>
)}
</div>
</Col>
</Row>
......@@ -3325,13 +3438,13 @@ class NewTP extends Component {
ref={c => (this.checkfirst = c)}
tags={this.tags}
logourl={this.logourl}
activityUrl={this.activityUrl}
receiveHtml={this.receiveHtml}
tpClassificationId={this.state.tpClassificationId}
onTrainKind={this.props.onTrainKind}
trainkindlist={this.props.trainkindlist}
// trainfirstinfo={this.props.trainfirstinfo} //bug-11153-liyuan 新增项目会出现缓存名称和时间
trainfirstinfo={this.props.trainfirstinfo}
nodescription={this.state.nodescription}
disabledTime={this.disabledTime}
/>
......@@ -3376,30 +3489,30 @@ class NewTP extends Component {
/>
) : this.props.trainfirstinfo.enableEnroll == 1 &&
this.props.enrollinfolist.personLimitNum ? (
<NewEnrollForm
key={this.state.refreshEnrollForm}
ref={c => (this.enrollform = c)}
infoTitle={this.state.infoTitle}
enrollinfolist={this.props.enrollinfolist}
enrollInfoClear={this.props.enrollInfoClear}
disabledEndTime={this.state.disabledEndTime}
getEnrollOriginalPrice={this.getEnrollOriginalPrice}
/>
) : (
<NewEnrollForm
key={this.state.refreshEnrollForm}
ref={c => (this.enrollform = c)}
infoTitle={this.state.infoTitle}
enrollinfolist={this.props.enrollinfolist}
enrollInfoClear={this.props.enrollInfoClear}
disabledEndTime={this.state.disabledEndTime}
getEnrollOriginalPrice={this.getEnrollOriginalPrice}
/>
)}
<NewEnrollForm
key={this.state.refreshEnrollForm}
ref={c => (this.enrollform = c)}
infoTitle={this.state.infoTitle}
enrollinfolist={this.props.enrollinfolist}
enrollInfoClear={this.props.enrollInfoClear}
disabledEndTime={this.state.disabledEndTime}
getEnrollOriginalPrice={this.getEnrollOriginalPrice}
/>
) : (
<NewEnrollForm
key={this.state.refreshEnrollForm}
ref={c => (this.enrollform = c)}
infoTitle={this.state.infoTitle}
enrollinfolist={this.props.enrollinfolist}
enrollInfoClear={this.props.enrollInfoClear}
disabledEndTime={this.state.disabledEndTime}
getEnrollOriginalPrice={this.getEnrollOriginalPrice}
/>
)}
</div>
) : (
""
)}
""
)}
<div style={{ height: "20px" }} />
{/* 签到 */}
<div>
......@@ -3454,8 +3567,8 @@ class NewTP extends Component {
needPosition={this.state.signPosition}
/>
) : (
""
)}
""
)}
</div>
</div>
<div style={{ height: "20px" }} />
......@@ -3486,36 +3599,38 @@ class NewTP extends Component {
<div style={{ textAlign: "left" }}>
{/* {this.props.newsProject.length>0&&<Remind ref={(obj)=>this.remindseting=obj} seeting={this.props.trainsetting.remindVo} title={this.state.title} newsList={this.props.newsProject} />} */}
{this.props.trainsetting.remindVo &&
this.props.trainsetting.remindVo.enableApp ? (
<MessageRemind
formItemLayout={formItemLayout2}
relationType={8}
relationId={this.props.trainsetting.trainingProjectId}
remind={this.props.trainsetting.remindVo.enableApp}
wrappedComponentRef={form =>
(this.messageRemind = form)
}
/>
) : (
<MessageRemind
formItemLayout={formItemLayout2}
relationType={8}
wrappedComponentRef={form =>
(this.messageRemind = form)
}
/>
)}
{
this.state.isPayTrain ?
<SettingPayInList
showInList={this.props.trainsetting.enableQueue}
disabled={this.state.title == "查看项目" ? true : false}
getFieldDecorator={getFieldDecorator}
changeShowInList={this.changeShowInList}
formItemLayout={formItemLayout2}
/> : ""
}
this.props.trainsetting.remindVo.enableApp ? (
<MessageRemind
formItemLayout={formItemLayout2}
relationType={8}
relationId={this.props.trainsetting.trainingProjectId}
remind={this.props.trainsetting.remindVo.enableApp}
wrappedComponentRef={form =>
(this.messageRemind = form)
}
/>
) : (
<MessageRemind
formItemLayout={formItemLayout2}
relationType={8}
wrappedComponentRef={form =>
(this.messageRemind = form)
}
/>
)}
{this.state.isPayTrain ? (
<SettingPayInList
showInList={this.props.trainsetting.enableQueue}
disabled={
this.state.title == "查看项目" ? true : false
}
getFieldDecorator={getFieldDecorator}
changeShowInList={this.changeShowInList}
formItemLayout={formItemLayout2}
/>
) : (
""
)}
<Task
taskValue={this.props.trainsetting.enableTask}
......@@ -3553,30 +3668,30 @@ class NewTP extends Component {
)}
</Form.Item>
) : (
<Form.Item {...formItemLayout} label="设置积分: ">
{getFieldDecorator("point", {
initialValue:
this.props.trainsetting.point === 0
? 0
: this.props.trainsetting.point
? this.props.trainsetting.point
: "",
rules: [
{
required: false,
pattern: /^[0-9]\d*$/,
message: "请输入正确积分",
},
],
})(
<Input
defaultValue="0"
style={{ marginLeft: "10px" }}
disabled={usable}
/>
)}
</Form.Item>
)}
<Form.Item {...formItemLayout} label="设置积分: ">
{getFieldDecorator("point", {
initialValue:
this.props.trainsetting.point === 0
? 0
: this.props.trainsetting.point
? this.props.trainsetting.point
: "",
rules: [
{
required: false,
pattern: /^[0-9]\d*$/,
message: "请输入正确积分",
},
],
})(
<Input
defaultValue="0"
style={{ marginLeft: "10px" }}
disabled={usable}
/>
)}
</Form.Item>
)}
</div>
</div>
</div>
......@@ -3658,8 +3773,8 @@ class NewTP extends Component {
</div>
</Modal>
) : (
""
)}
""
)}
{/*新增可见范围*/}
<Modal
......@@ -3669,7 +3784,7 @@ class NewTP extends Component {
onOk={this.saveTrainViewRange}
key={this.state.keyId}
destroyOnClose={1}
// footer={null}
// footer={null}
>
{/*测试初始化this.state.traniData状态*/}
<LinkUser
......@@ -3739,8 +3854,12 @@ class NewTP extends Component {
openResource={this.openResource}
></ResourceListView>
</Modal>
<img id="miniCode" src="https://customproject.oss-cn-shanghai.aliyuncs.com/photo/fixedPositionCode.png" crossOrigin="Anonymous" style={{ 'display': 'none' }} />
<img
id="miniCode"
src="https://customproject.oss-cn-shanghai.aliyuncs.com/photo/fixedPositionCode.png"
crossOrigin="Anonymous"
style={{ display: "none" }}
/>
</div>
);
}
......@@ -3750,6 +3869,7 @@ function mapStateToProps(state, ownProps) {
return {
trainlist: state.train.trainlist,
trainkindlist: state.train.trainkindlist,
activityList: state.train.activityList,
resultcode: state.train.resultcode,
qcodelist: state.train.qcodelist,
trainfirstinfo: state.train.trainfirstinfo,
......@@ -3775,15 +3895,15 @@ function mapDispatchToProps(dispatch) {
// 下架培训项目
onDownPro: (param, callback) => dispatch(downPro(param, callback)),
// 项目分类
// 活动分类
onTrainKind: obj => dispatch(trainKind(obj)),
// 项目分类保存
// 活动分类保存
onTrainKindSave: (param, callback) =>
dispatch(trainKindSave(param, callback)),
// 项目分类删除
// 活动分类删除
onTrainKindDelete: (param, callback) =>
dispatch(trainKindDelete(param, callback)),
// 项目分类修改
// 活动分类修改
onTrainKindUpdate: (param, callback) =>
dispatch(trainKindUpdate(param, callback)),
......
......@@ -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;
import React, { Component, Fragment } from 'react';
import React, { Component, Fragment } from "react";
import { Upload, message, Button } from "antd";
import { gupfetch } from "@/common/UpLoad/redux/actions";
import { connect } from "react-redux"
import { connect } from "react-redux";
import AudioBackPlay from "../../../audiobackplay";
import intl from "react-intl-universal";
class AudioUploadComponent extends Component {
constructor(props) {
super(props)
this.state = {
uploadAction: "",
uploadParams: {},
fileList: [],
uploadPercent: 0,
uploadProgress: false,
originalFileUrl: "",
refreshAudio: ""
}
constructor(props) {
super(props);
this.state = {
uploadAction: "",
uploadParams: {},
fileList: [],
uploadPercent: 0,
uploadProgress: false,
originalFileUrl: "",
refreshAudio: "",
};
}
componentDidMount() {
this.props.gupfetch();
const { defaultList } = this.props;
this.setState({
fileList: defaultList,
refreshAudio: new Date().getTime(),
});
}
beforeUpload = (file, fileList) => {
if (fileList.length > 1) {
message.error(intl.get("OnlyImportOneFile") || "一次只能导入一个文件");
this.setState({ fileList: [] });
return false;
}
componentDidMount() {
this.props.gupfetch();
const { defaultList } = this.props;
this.setState({
fileList: defaultList,
refreshAudio: new Date().getTime()
})
const { param } = this.props;
const types1 = ["mp3"];
const type1 = file.name
.split(".")
.pop()
.toLowerCase();
if (!types1.includes(type1)) {
this.setState({ fileList: [] });
message.error(intl.get("practiceText46"));
return false;
}
beforeUpload = (file, fileList) => {
if (fileList.length > 1) {
message.error(intl.get('OnlyImportOneFile') || "一次只能导入一个文件");
this.setState({ fileList: [] });
return false;
}
const { param } = this.props;
const types1 = ["mp3"];
const type1 = file.name
.split(".")
.pop()
.toLowerCase();
if (!types1.includes(type1)) {
this.setState({ fileList: [] });
message.error(intl.get("practiceText46"));
return false;
}
if (file.size >= 1024 * 1024 * 1024) {
message.error(intl.get("practiceText47"));
return false;
}
const fileLength = file.name.split(".").length;
let fileName = file.uid + "-uid-" + new Date().getTime();
this.setState({
uploadParams: {
Filename:
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
key:
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
policy: param.policy,
OSSAccessKeyId: param.accessid,
success_action_status: "200",
signature: param.signature,
},
uploadAction: param.host,
originalFileUrl:
param.host +
"/" +
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
uploadProgress: true,
fileList: fileList,
});
if (file.size >= 1024 * 1024 * 1024) {
message.error(intl.get("practiceText47"));
return false;
}
handleChange = (info) => {
if (info.event) {
this.setState({
uploadPercent: info.event.percent.toFixed(0) - 0,
});
}
let fileList = info.fileList;
fileList = fileList.slice(-1);
console.log(info.file);
if (info.file.status === "done") {
message.success(intl.get("caseadmin91"));
fileList[0].ossUrl = this.state.originalFileUrl;
this.setState({
fileList,
uploadPercent: 100,
uploadProgress: false,
refreshAudio: new Date().getTime()
});
this.props.getFileList(fileList);
}
if (info.file.status === "error") {
message.error(intl.get("comment2"));
this.setState({ fileList: [], uploadProgress: false });
}
const fileLength = file.name.split(".").length;
let fileName = file.uid + "-uid-" + new Date().getTime();
this.setState({
uploadParams: {
Filename:
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
key:
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
policy: param.policy,
OSSAccessKeyId: param.accessid,
success_action_status: "200",
signature: param.signature,
},
uploadAction: param.host,
originalFileUrl:
param.host +
"/" +
param.dir +
"/" +
fileName +
"." +
file.name.split(".")[fileLength - 1],
uploadProgress: true,
fileList: fileList,
});
};
handleChange = info => {
if (info.event) {
this.setState({
uploadPercent: info.event.percent.toFixed(0) - 0,
});
}
removeFile = (file) => {
this.setState({ fileList: [] });
this.props.getFileList([]);
let fileList = info.fileList;
fileList = fileList.slice(-1);
console.log(info.file);
if (info.file.status === "done") {
message.success(intl.get("caseadmin91"));
fileList[0].ossUrl = this.state.originalFileUrl;
this.setState({
fileList,
uploadPercent: 100,
uploadProgress: false,
refreshAudio: new Date().getTime(),
});
this.props.getFileList(fileList);
}
render() {
const { uploadAction, uploadParams, fileList, refreshAudio } = this.state;
const { disabled } = this.props;
return (<Fragment>
{
!disabled ?
<Upload
headers={{ "X-Requested-With": null }}
beforeUpload={this.beforeUpload}
action={uploadAction}
data={uploadParams}
onChange={this.handleChange}
onRemove={this.removeFile}
fileList={fileList}
showUploadList={false}
>
{
fileList.length <= 0 ?
<Fragment>
<Button type="primary">{intl.get("practiceText48")}</Button>
<br />
<span style={{ color: "#aaa" }}>{intl.get("practiceText46")}</span>
</Fragment>
: ""
}
</Upload> :
fileList.length <= 0 ?
<Fragment>
<Button type="primary" disabled={true}>{intl.get("practiceText48")}</Button>
<br />
<span style={{ color: "#aaa" }}>{intl.get("practiceText46")}</span>
</Fragment>
: ""
}
{
fileList.length > 0 ?
<AudioBackPlay
key={refreshAudio}
showName={true}
name={fileList[0].name||"自动合成的语音"}
remove={this.removeFile}
audioUrl={fileList[0].url}
noAudioText={""}
disabled={disabled}
/> : ""
}
</Fragment>
)
if (info.file.status === "error") {
message.error(intl.get("comment2"));
this.setState({ fileList: [], uploadProgress: false });
}
};
removeFile = file => {
this.setState({ fileList: [] });
this.props.getFileList([]);
};
render() {
const { uploadAction, uploadParams, fileList, refreshAudio } = this.state;
const { disabled } = this.props;
return (
<Fragment>
{!disabled ? (
<Upload
headers={{ "X-Requested-With": null }}
beforeUpload={this.beforeUpload}
action={uploadAction}
data={uploadParams}
onChange={this.handleChange}
onRemove={this.removeFile}
fileList={fileList}
showUploadList={false}
>
{fileList.length <= 0 ? (
<Fragment>
<Button type="primary">{intl.get("practiceText48")}</Button>
<br />
<span style={{ color: "#aaa" }}>
{intl.get("practiceText46")}
</span>
</Fragment>
) : (
""
)}
</Upload>
) : fileList.length <= 0 ? (
<Fragment>
<Button type="primary" disabled={true}>
{intl.get("practiceText48")}
</Button>
<br />
<span style={{ color: "#aaa" }}>{intl.get("practiceText46")}</span>
</Fragment>
) : (
""
)}
{fileList.length > 0 ? (
<AudioBackPlay
key={refreshAudio}
showName={true}
name={fileList[0].name || "自动合成的语音"}
remove={this.removeFile}
audioUrl={fileList[0].url}
noAudioText={""}
disabled={disabled}
/>
) : (
""
)}
</Fragment>
);
}
}
function mapStateToProps(state, ownProps) {
return {
//数字签名
param: state.uploadParam.param,
};
return {
//数字签名
param: state.uploadParam.param,
};
}
function mapDispatchToProps(dispatch) {
return {
//获取上传数字签名
gupfetch: () => dispatch(gupfetch()),
};
return {
//获取上传数字签名
gupfetch: () => dispatch(gupfetch()),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(AudioUploadComponent)
export default connect(
mapStateToProps,
mapDispatchToProps
)(AudioUploadComponent);
......@@ -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