Commit 95c86962 by 潘本斌

1

parent 58e6835e
...@@ -18,7 +18,7 @@ console.log(process.env.NODE_ENV,'============') ...@@ -18,7 +18,7 @@ console.log(process.env.NODE_ENV,'============')
var rootPath = path.resolve(__dirname, ".."); var rootPath = path.resolve(__dirname, "..");
module.exports = _.merge(config, { module.exports = _.merge(config, {
optimization: { optimization: {
minimize: true, minimize: false,
runtimeChunk: { runtimeChunk: {
name: entrypoint => `runtime~${entrypoint.name}` name: entrypoint => `runtime~${entrypoint.name}`
}, },
......
File added
.bread { .bread {
position : fixed; position : fixed;
top : 64px; top : 72px;
right : 0; right: 15px;
width : calc(100% - 200px); width: calc(100% - 230px);
z-index : 29; z-index : 29;
transition : width 0.2s; transition : width 0.2s;
height : 60px; height : 60px;
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
box-shadow:0px 1px 4px 0px rgba(0,21,41,0.12); // box-shadow:0px 1px 4px 0px rgba(0,21,41,0.12);
} }
.collapsed { .collapsed {
position : fixed; position : fixed;
top : 64px; top : 72px;
right : 0; right : 15px;
width : calc(100% - 200px); width : calc(100% - 200px);
z-index : 29; z-index : 29;
transition : width 0.2s; transition : width 0.2s;
height : 60px; height : 60px;
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
width : ~"calc(100% - 80px)"; width : ~"calc(100% - 110px)";
box-shadow:0px 1px 4px 0px rgba(0,21,41,0.12); // box-shadow:0px 1px 4px 0px rgba(0,21,41,0.12);
} }
\ No newline at end of file
/** /**
* 更多文档:https://www.yuque.com/braft-editor/be/ * 更多文档:https://www.yuque.com/braft-editor/be/
* *
* *
* */ * */
import React, { PureComponent } from "react"; import React, { PureComponent } from "react";
import BraftEditor from "braft-editor"; import BraftEditor from "braft-editor";
...@@ -11,7 +10,7 @@ import "braft-editor/dist/index.css"; ...@@ -11,7 +10,7 @@ import "braft-editor/dist/index.css";
import styles from "./editor.less"; import styles from "./editor.less";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { gupfetch } from "../UpLoad/redux/actions"; import { gupfetch } from "../UpLoad/redux/actions";
import services from "@/services/serve";
class Editor extends PureComponent { class Editor extends PureComponent {
constructor() { constructor() {
super(...arguments); super(...arguments);
...@@ -274,22 +273,24 @@ class Editor extends PureComponent { ...@@ -274,22 +273,24 @@ class Editor extends PureComponent {
const fileName = `${param.id + time}.${ const fileName = `${param.id + time}.${
param.file.name.split(".")[param.file.name.split(".").length - 1] param.file.name.split(".")[param.file.name.split(".").length - 1]
}`; }`;
fd.append("name", param.file.name); // fd.append("name", param.file.name);
fd.append("Filename", `${uploadParam.dir}/${fileName}`); // fd.append("Filename", `${uploadParam.dir}/${fileName}`);
fd.append("key", `${uploadParam.dir}/${fileName}`); // fd.append("key", `${uploadParam.dir}/${fileName}`);
fd.append("policy", uploadParam.policy); // fd.append("policy", uploadParam.policy);
fd.append("OSSAccessKeyId", uploadParam.accessid); // fd.append("OSSAccessKeyId", uploadParam.accessid);
fd.append("success_action_status", "200"); // fd.append("success_action_status", "200");
fd.append("signature", uploadParam.signature); // fd.append("signature", uploadParam.signature);
fd.append("file", param.file); fd.append("file", param.file);
xhr.open("POST", serverURL, true); xhr.open("POST", services.uploadApi, true);
xhr.setRequestHeader("Authorization", sessionStorage.getItem("mgtk"));
xhr.send(fd); xhr.send(fd);
const successFn = response => { const successFn = response => {
var responses = JSON.parse(xhr.responseText);
// 假设服务端直接返回文件上传后的地址 // 假设服务端直接返回文件上传后的地址
// 上传成功后调用param.success并传入上传后的文件地址 // 上传成功后调用param.success并传入上传后的文件地址
param.success({ param.success({
url: `${uploadParam.host}/${uploadParam.dir}/${fileName}`, url: responses.data,
meta: { meta: {
id: "1", id: "1",
title: "1", title: "1",
......
...@@ -72,7 +72,7 @@ class Header extends PureComponent { ...@@ -72,7 +72,7 @@ class Header extends PureComponent {
id="layoutHeader" id="layoutHeader"
> >
<div> <div>
{collapsed && ( {/* {collapsed && (
<div <div
className={styles.button} className={styles.button}
onClick={onCollapseChange.bind(this, !collapsed)} onClick={onCollapseChange.bind(this, !collapsed)}
...@@ -84,14 +84,14 @@ class Header extends PureComponent { ...@@ -84,14 +84,14 @@ class Header extends PureComponent {
})} })}
/> />
</div> </div>
)} )} */}
<div className={styles.logo}> {/* <div className={styles.logo}>
<img <img
className={styles.image} className={styles.image}
// src={nav.logo ? nav.logo : headerLogo} // src={nav.logo ? nav.logo : headerLogo}
src={headerLogo} src={headerLogo}
/> />
</div> </div> */}
</div> </div>
<div className={styles.rightContainer}> <div className={styles.rightContainer}>
{/* bug-11961-cwj暂时注释 2期上 */} {/* bug-11961-cwj暂时注释 2期上 */}
...@@ -107,7 +107,7 @@ class Header extends PureComponent { ...@@ -107,7 +107,7 @@ class Header extends PureComponent {
<div className={styles.assText}>社群平台</div> <div className={styles.assText}>社群平台</div>
</a> </a>
)} */} )} */}
<Tooltip title={"使用帮助"}> {/* <Tooltip title={"使用帮助"}>
<a <a
target="_blank" target="_blank"
href="http://help.fairyclass.cn/hc/" href="http://help.fairyclass.cn/hc/"
...@@ -116,7 +116,7 @@ class Header extends PureComponent { ...@@ -116,7 +116,7 @@ class Header extends PureComponent {
> >
<Icon type="question-circle-o" /> <Icon type="question-circle-o" />
</a> </a>
</Tooltip> </Tooltip> */}
<Tooltip title={"站点切换"}> <Tooltip title={"站点切换"}>
<Dropdown <Dropdown
overlay={siteMenu} overlay={siteMenu}
......
import React, { PureComponent, Fragment } from "react"; import React, { PureComponent, Fragment } from "react";
import { Menu, Icon } from "antd"; import { Menu, Icon } from "antd";
import IconFont from "@/common/IconFont"; import IconFont from "@/common/IconFont";
import { set as setGlobalData, get as getGlobalData } from "@/util/globalData.js"; import {
set as setGlobalData,
get as getGlobalData,
} from "@/util/globalData.js";
import { Link, withRouter } from "react-router-dom"; import { Link, withRouter } from "react-router-dom";
import styles from "./Sider.less"; import styles from "./Sider.less";
import { arrayToTree, queryAncestors, pathMatchRegexp } from "@/util/index"; import { arrayToTree, queryAncestors, pathMatchRegexp } from "@/util/index";
...@@ -54,7 +57,15 @@ class SiderMenu extends PureComponent { ...@@ -54,7 +57,15 @@ class SiderMenu extends PureComponent {
<Fragment> <Fragment>
{item.icon && ( {item.icon && (
// <IconFont className={item.id==currentMenuId&&this.props.collapsed?styles.activeIconFont:""} key={item.id} type={item.id==currentMenuId ? item.activeIcon : item.icon} /> // <IconFont className={item.id==currentMenuId&&this.props.collapsed?styles.activeIconFont:""} key={item.id} type={item.id==currentMenuId ? item.activeIcon : item.icon} />
<IconFont className={item.id == currentMenuId && this.props.collapsed ? styles.activeIconFont : ""} key={item.id} type={item.icon} /> <IconFont
className={
item.id == currentMenuId && this.props.collapsed
? styles.activeIconFont
: ""
}
key={item.id}
type={item.icon}
/>
)} )}
<span>{item.name}</span> <span>{item.name}</span>
</Fragment> </Fragment>
...@@ -64,31 +75,48 @@ class SiderMenu extends PureComponent { ...@@ -64,31 +75,48 @@ class SiderMenu extends PureComponent {
</SubMenu> </SubMenu>
); );
} }
return ( return item.menuType == 2 ? (
item.menuType == 2 ? <Menu.ItemGroup title={item.name} key={item.id}></Menu.ItemGroup> : <Menu.ItemGroup title={item.name} key={item.id}></Menu.ItemGroup>
<Menu.Item key={item.id}> ) : (
{item.url && <Menu.Item key={item.id}>
<Link {item.url && (
to={`${match.url}${item.url.trim()}`}// bug-12622-cwj <Link
onClick={() => { to={`${match.url}${item.url.trim()}`} // bug-12622-cwj
setGlobalData("breadName", item.name); onClick={() => {
setGlobalData("currentMenuId", item.id[0] - 0); setGlobalData("breadName", item.name);
}} setGlobalData("currentMenuId", item.id[0] - 0);
> }}
<span className='title'>{item.name}</span> >
<span style={{ float: "right" }}>{item.total}</span> {item.icon && (
{/* <span>{item.total}</span> */} <IconFont
</Link> className={
} item.id == currentMenuId ? styles.activeIconFont : ""
{!item.url && }
<div key={item.id}
> type={item.icon}
<IconFont className={item.id == currentMenuId && this.props.collapsed ? styles.activeIconFont : ""} key={item.id} type={item.icon} /> />
<span className='title'>{item.name}</span> )}
<span style={{ float: "right" }}>{item.total}</span> <span className="title">{item.name}</span>
</div> <span style={{ float: "right" }}>{item.total}</span>
} {/* <span>{item.total}</span> */}
</Menu.Item> </Link>
)}
{!item.url && (
<div>
<IconFont
className={
item.id == currentMenuId && this.props.collapsed
? styles.activeIconFont
: ""
}
key={item.id}
type={item.icon}
/>
<span className="title">{item.name}</span>
<span style={{ float: "right" }}>{item.total}</span>
</div>
)}
</Menu.Item>
); );
}); });
}; };
...@@ -96,7 +124,7 @@ class SiderMenu extends PureComponent { ...@@ -96,7 +124,7 @@ class SiderMenu extends PureComponent {
render() { render() {
const { collapsed, theme, menus, match } = this.props; const { collapsed, theme, menus, match } = this.props;
// Generating tree-structured data for menu content. // Generating tree-structured data for menu content.
let nwesmenus = menus.filter(item => item.name !== '社群'); let nwesmenus = menus.filter(item => item.name !== "社群");
const menuTree = arrayToTree(nwesmenus, "id", "menuParentId"); const menuTree = arrayToTree(nwesmenus, "id", "menuParentId");
// Find a menu that matches the pathname. // Find a menu that matches the pathname.
...@@ -115,7 +143,6 @@ class SiderMenu extends PureComponent { ...@@ -115,7 +143,6 @@ class SiderMenu extends PureComponent {
: []; : [];
const menuProps = collapsed ? {} : { openKeys: this.state.openKeys }; const menuProps = collapsed ? {} : { openKeys: this.state.openKeys };
return ( return (
<Menu <Menu
mode="inline" mode="inline"
...@@ -125,7 +152,6 @@ class SiderMenu extends PureComponent { ...@@ -125,7 +152,6 @@ class SiderMenu extends PureComponent {
defaultOpenKeys={this.state.openKeys} defaultOpenKeys={this.state.openKeys}
defaultSelectedKeys={selectedKeys} defaultSelectedKeys={selectedKeys}
{...menuProps} {...menuProps}
> >
{this.generateMenus(menuTree, selectedKeys)} {this.generateMenus(menuTree, selectedKeys)}
</Menu> </Menu>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:global { :global {
.ant-menu-vertical.ant-menu-sub { .ant-menu-vertical.ant-menu-sub {
background-image: linear-gradient(to bottom, #404C5B, #2E3945); // background-image: linear-gradient(to bottom, #404C5B, #2E3945);
overflow-x: scroll; overflow-x: scroll;
max-height: 100vh; max-height: 100vh;
.ant-menu-item-active, .ant-menu-item-active,
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.ant-menu-item-selected { .ant-menu-item-selected {
opacity : 0.85; opacity : 0.85;
background : rgba(255, 255, 255, 1); background : #D23A29;
border-radius: 4px; border-radius: 4px;
margin-left : 8px; margin-left : 8px;
text-indent: -8px; text-indent: -8px;
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
.title { .title {
font-weight: 400; font-weight: 400;
color : rgba(0, 0, 0, 1); color : white;
} }
} }
...@@ -37,12 +37,16 @@ ...@@ -37,12 +37,16 @@
.ant-menu-submenu-selected { .ant-menu-submenu-selected {
opacity : 0.85; opacity : 0.85;
background : rgba(255, 255, 255, 1); background : #D23A29;
border-radius: 4px; border-radius: 4px;
margin-left : 8px; margin-left : 8px;
text-indent: -8px; text-indent: -8px;
width : ~"calc(100% - 16px)"; width : ~"calc(100% - 16px)";
color : rgba(0, 0, 0, 1); color : rgba(0, 0, 0, 1);
.title {
font-weight: 400;
color : white;
}
.ant-menu-submenu-title { .ant-menu-submenu-title {
&:hover { &:hover {
...@@ -94,8 +98,9 @@ ...@@ -94,8 +98,9 @@
.sider { .sider {
box-shadow : fade(@primary-color, 10%) 0 0 28px 0; box-shadow : fade(@primary-color, 10%) 0 0 28px 0;
z-index : 10; z-index : 30;
background-image: linear-gradient(to bottom, #404C5B, #2E3945); background: #282733;
// background-image: linear-gradient(to bottom, #404C5B, #2E3945);
:global { :global {
.ant-layout-sider-children { .ant-layout-sider-children {
display : flex; display : flex;
...@@ -117,6 +122,10 @@ ...@@ -117,6 +122,10 @@
width : 100%; width : 100%;
.extCni{ .extCni{
cursor: pointer; cursor: pointer;
& img{
width: 120px;
height: 40px;
}
&:hover{ &:hover{
.icon,.logoText{ .icon,.logoText{
color: #fff; color: #fff;
...@@ -130,27 +139,7 @@ ...@@ -130,27 +139,7 @@
margin-left: 5px; margin-left: 5px;
} }
.button {
margin-left: 20px;
float : left;
text-align : center;
font-size : 24px;
cursor : pointer;
transition : @transition-ease-in;
&:hover{
.icon {
color: #fff;
}
}
.menuFold {
color : rgba(255, 255, 255, .65);
&:hover{
color: #fff;
}
}
}
.icon { .icon {
font-size: 20px; font-size: 20px;
...@@ -158,6 +147,7 @@ ...@@ -158,6 +147,7 @@
} }
} }
.logoOne { .logoOne {
display : flex; display : flex;
align-items : center; align-items : center;
...@@ -181,6 +171,12 @@ ...@@ -181,6 +171,12 @@
color: red; color: red;
} }
} }
.icon1{
background: url('./img/3.png') no-repeat;
background-size: 100% 100%;
width: 32px ;
height: 32px;
}
.logo { .logo {
width: 100%; width: 100%;
...@@ -208,6 +204,53 @@ ...@@ -208,6 +204,53 @@
} }
} }
} }
.button {
background: url('./img/2.png') no-repeat;
background-size: 100% 100%;
z-index: 31;
margin-left: 20px;
float : left;
text-align : center;
cursor : pointer;
transition : @transition-ease-in;
width: 32px;
height: 32px;
position: absolute;
right: -16px;
top:16px;
border-radius: 16px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
&:hover{
.icon {
color: #fff;
}
}
}
.button1 {
background: url('./img/2.png') no-repeat;
background-size: 100% 100%;
z-index: 31;
transform: rotate(180deg);
margin-left: 20px;
float : left;
text-align : center;
cursor : pointer;
transition : @transition-ease-in;
width: 32px;
height: 32px;
position: absolute;
border-radius: 16px;
box-shadow: -3px -2px 5px rgba(0, 0, 0, 0.5);
right: -16px;
top:16px;
&:hover{
.icon {
color: #fff;
}
}
}
.menuContainer { .menuContainer {
height : ~"calc(100vh - 120px)"; height : ~"calc(100vh - 120px)";
...@@ -257,7 +300,7 @@ ...@@ -257,7 +300,7 @@
.ant-menu-item-selected { .ant-menu-item-selected {
opacity : 0.85; opacity : 0.85;
background : rgba(255, 255, 255, 1); background :#D23A29;
border-radius: 4px; border-radius: 4px;
margin-left : 8px; margin-left : 8px;
text-indent: -8px; text-indent: -8px;
...@@ -265,7 +308,7 @@ ...@@ -265,7 +308,7 @@
.title { .title {
font-weight: 400; font-weight: 400;
color : rgba(0, 0, 0, 1); color : white;
} }
} }
} }
......
...@@ -5,6 +5,8 @@ import SiderMenu from "./Menu"; ...@@ -5,6 +5,8 @@ import SiderMenu from "./Menu";
import styles from "./Sider.less"; import styles from "./Sider.less";
import IconFont from "@/common/IconFont"; import IconFont from "@/common/IconFont";
import classnames from "classnames"; import classnames from "classnames";
import img1 from "./img/1.png";
import img2 from "./img/2.png";
class Sider extends PureComponent { class Sider extends PureComponent {
render() { render() {
...@@ -29,38 +31,46 @@ class Sider extends PureComponent { ...@@ -29,38 +31,46 @@ class Sider extends PureComponent {
collapsible collapsible
collapsed={collapsed} collapsed={collapsed}
className={styles.sider} className={styles.sider}
> >
<div className={styles.brand}> <div className={styles.brand}>
<div className={styles.logo}> <div className={styles.logo}>
{collapsed ? ( {collapsed ? (
<div className={styles.logoOne} > <div className={styles.logoOne}>
<a onClick={onDashboardClick}> <a onClick={onDashboardClick}>
<div className={styles.icon}><IconFont type='icon-dashboard1' /></div> <div className={styles.icon}>
<div className={styles.icon1} />
</div>
</a> </a>
</div> </div>
) : ( ) : (
<div className={styles.logoAll}> <div className={styles.logoAll}>
<span className={styles.extCni} onClick={onDashboardClick} style={{display:"flex"}}> <span
<div className={styles.icon}><IconFont type='icon-dashboard1' /></div> className={styles.extCni}
<div className={styles.logoText}>Dashboard</div> onClick={onDashboardClick}
style={{ display: "block", margin: "0 auto" }}
>
<img src={img1} alt="" />
{/* <div className={styles.icon}>
<IconFont type="icon-dashboard1" />
</div>
<div className={styles.logoText}>Dashboard</div> */}
</span> </span>
<div
className={styles.button}
onClick={onCollapseChange.bind(this, !collapsed)}
>
<Icon
className={styles.menuFold}
type={classnames({
"menu-unfold": collapsed,
"menu-fold": !collapsed,
})}
/>
</div>
</div> </div>
)} )}
</div> </div>
</div> </div>
<div
className={collapsed ? styles.button1 : styles.button}
onClick={onCollapseChange.bind(this, !collapsed)}
>
{/* <Icon
className={styles.menuFold}
type={classnames({
"menu-unfold": collapsed,
"menu-fold": !collapsed,
})}
/> */}
</div>
<div className={styles.menuContainer} id={"styles_sider"}> <div className={styles.menuContainer} id={"styles_sider"}>
<ScrollBar <ScrollBar
......
...@@ -4,6 +4,7 @@ import { Upload, Icon, Form, Button, message, Progress } from "antd"; ...@@ -4,6 +4,7 @@ import { Upload, Icon, Form, Button, message, Progress } from "antd";
//上传阿里云action //上传阿里云action
import { gupList, gupfetch } from "./redux/actions"; import { gupList, gupfetch } from "./redux/actions";
import "./index.less"; import "./index.less";
import services from "@/services/serve";
// form Item // form Item
const FormItem = Form.Item; const FormItem = Form.Item;
class UploadUtil extends Component { class UploadUtil extends Component {
...@@ -16,13 +17,13 @@ class UploadUtil extends Component { ...@@ -16,13 +17,13 @@ class UploadUtil extends Component {
originalFileUrl: "", originalFileUrl: "",
fileList: [], fileList: [],
key: "", key: "",
processNum: 0 //进度条--liyuan processNum: 0, //进度条--liyuan
}; };
} }
//修改一 //修改一
componentDidMount() { componentDidMount() {
//上传阿里云 //上传阿里云
this.props.gupfetch(); // this.props.gupfetch();
} }
beforeUpload = (file, fileList) => { beforeUpload = (file, fileList) => {
...@@ -35,8 +36,8 @@ class UploadUtil extends Component { ...@@ -35,8 +36,8 @@ class UploadUtil extends Component {
// message.info("文件名不能使用特殊字符"); // message.info("文件名不能使用特殊字符");
// return false; // return false;
// } // }
if (file.size > 3 * 1024 * 1024) { if (file.size > 10 * 1024 * 1024) {
message.info("请上传小于3M的图片"); message.info("请上传小于10M的图片");
return false; return false;
} }
} else { } else {
...@@ -60,8 +61,8 @@ class UploadUtil extends Component { ...@@ -60,8 +61,8 @@ class UploadUtil extends Component {
//判断类型 学习营销名片只用上传图片` //判断类型 学习营销名片只用上传图片`
let reg = ""; //正则匹配格式 let reg = ""; //正则匹配格式
this.props.extra === "markeCardExtra" this.props.extra === "markeCardExtra"
? (reg = /(png|jpg|gif|jpeg)$/g) ? (reg = /(png|jpg|gif|jpeg|doc|docx|pdf|PDF|wps)$/g)
: (reg = /(mp4|png|jpg|gif|mp3|pdf|jpeg)$/g); : (reg = /(mp4|png|jpg|gif|mp3|pdf|jpeg|doc|docx|pdf|PDF|wps)$/g);
if (!reg.test(file.name)) { if (!reg.test(file.name)) {
message.error("文件类型不对"); message.error("文件类型不对");
return false; return false;
...@@ -71,26 +72,10 @@ class UploadUtil extends Component { ...@@ -71,26 +72,10 @@ class UploadUtil extends Component {
const fileLength = file.name.split(".").length; const fileLength = file.name.split(".").length;
this.setState( this.setState(
{ {
uploadParams: { uploadParams: {},
Filename: uploadAction: `${services.uploadApi}`,
param.dir + "/" + time + "." + file.name.split(".")[fileLength - 1],
key:
param.dir + "/" + time + "." + file.name.split(".")[fileLength - 1],
policy: param.policy,
OSSAccessKeyId: param.accessid,
success_action_status: "200",
signature: param.signature,
},
uploadAction: param.host,
originalFile: file.name, originalFile: file.name,
originalFileUrl: originalFileUrl: "",
param.host +
"/" +
param.dir +
"/" +
time +
"." +
file.name.split(".")[fileLength - 1],
}, },
() => { () => {
// 修改bug 6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示 // 修改bug 6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示
...@@ -109,16 +94,17 @@ class UploadUtil extends Component { ...@@ -109,16 +94,17 @@ class UploadUtil extends Component {
// this.setState({fileList}); // this.setState({fileList});
// } // }
//6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示 //6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示
this.setState({ //进度条--liyuan this.setState({
processNum: info.file.percent ? info.file.percent : 0 //进度条--liyuan
}) processNum: info.file.percent ? info.file.percent : 0,
});
if (fileList[0] && fileList[0].status === "done") { if (fileList[0] && fileList[0].status === "done") {
if (this.props.getUrl) { if (this.props.getUrl) {
this.props.getUrl(this.state.originalFileUrl, this.state.originalFile); this.props.getUrl(fileList[0].response.data, this.state.originalFile);
} }
console.log("检测打印变量=fileList ", fileList); console.log("检测打印变量=fileList ", fileList);
this.setState({ fileList }); this.setState({ fileList });
message.success("上传成功");//进度条--liyuan message.success("上传成功"); //进度条--liyuan
} }
//6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示 //6378 【UAT】【管理端】-名片配置-上传新图片修改时-名片预览未显示
if (fileList[0] && fileList[0].status === "error") { if (fileList[0] && fileList[0].status === "error") {
...@@ -153,8 +139,8 @@ class UploadUtil extends Component { ...@@ -153,8 +139,8 @@ class UploadUtil extends Component {
<FormItem <FormItem
extra={ extra={
this.props.extra === "markeCardExtra" this.props.extra === "markeCardExtra"
? "请上传资源附件(附件格式:png、jpg、jpeg、gif)" ? "请上传资源附件(附件格式:png、jpg、jpeg、gif、word、pdf)"
: "请上传资源附件(附件格式:mp4、png、jpg、jpeg、gif、mp3)" : "请上传资源附件(附件格式:mp4、png、jpg、jpeg、gif、mp3、word、pdf)"
} }
> >
{getFieldDecorator("upload", { {getFieldDecorator("upload", {
...@@ -164,10 +150,10 @@ class UploadUtil extends Component { ...@@ -164,10 +150,10 @@ class UploadUtil extends Component {
})( })(
<Upload <Upload
style={{ display: "inline-block" }} style={{ display: "inline-block" }}
headers={{ "X-Requested-With": null }}
beforeUpload={this.beforeUpload} beforeUpload={this.beforeUpload}
action={uploadAction} action={uploadAction}
data={uploadParams} headers={{ authorization: sessionStorage.getItem("mgtk") }}
// data={uploadParams}
onChange={this.handleChange} onChange={this.handleChange}
onRemove={this.fnRemove} onRemove={this.fnRemove}
> >
...@@ -179,9 +165,16 @@ class UploadUtil extends Component { ...@@ -179,9 +165,16 @@ class UploadUtil extends Component {
</Button> </Button>
</Upload> </Upload>
)} )}
{(this.state.processNum != 0 && this.state.processNum != 100) && <p> {this.state.processNum != 0 && this.state.processNum != 100 && (
<Progress percent={this.state.processNum} strokeWidth={5} showInfo={false}/> <p>
</p>}{/*//进度条--liyuan*/} <Progress
percent={this.state.processNum}
strokeWidth={5}
showInfo={false}
/>
</p>
)}
{/*//进度条--liyuan*/}
</FormItem> </FormItem>
</Form> </Form>
); );
......
...@@ -5,15 +5,25 @@ ...@@ -5,15 +5,25 @@
* react-cropper:更多选项参数look官方地址:http://roadmanfong.github.io/react-cropper * react-cropper:更多选项参数look官方地址:http://roadmanfong.github.io/react-cropper
* *
*/ */
import React, { Component,createRef } from "react"; import React, { Component, createRef } from "react";
import { Row, Icon, Button, Upload, Modal, Divider, Radio,message } from "antd"; import {
Row,
Icon,
Button,
Upload,
Modal,
Divider,
Radio,
message,
} from "antd";
import Cropper from "react-cropper"; import Cropper from "react-cropper";
import "./cropper.css"; //必须引入该css文件! import "./cropper.css"; //必须引入该css文件!
import { connect } from "react-redux"; import { connect } from "react-redux";
import { gupfetch } from "@/common/UpLoad/redux/actions"; import { gupfetch } from "@/common/UpLoad/redux/actions";
import axios from "axios"; import request from "@/util/request.js";
import services from "@/services/serve";
function mapStateToProps(state) { function mapStateToProps(state) {
return { return {
...@@ -28,15 +38,16 @@ function mapDispatchToProps(dispatch) { ...@@ -28,15 +38,16 @@ function mapDispatchToProps(dispatch) {
} }
//将base64转换为文件 //将base64转换为文件
function dataURLtoFile(dataurl, filename) { function dataURLtoFile(dataurl, filename) {
var arr = dataurl.split(","), const arr = dataurl.split(",");
mime = arr[0].match(/:(.*?);/)[1], const mime = arr[0].match(/:(.*?);/)[1];
bstr = atob(arr[1]), const suffix = mime.split("/")[1];
n = bstr.length, const bstr = atob(arr[1]);
u8arr = new Uint8Array(n); let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) { while (n--) {
u8arr[n] = bstr.charCodeAt(n); u8arr[n] = bstr.charCodeAt(n);
} }
return new File([u8arr], filename, { type: mime }); return new File([u8arr], `${filename}.${suffix}`, { type: mime });
} }
class UploadImageCover extends Component { class UploadImageCover extends Component {
...@@ -72,14 +83,14 @@ class UploadImageCover extends Component { ...@@ -72,14 +83,14 @@ class UploadImageCover extends Component {
this.props.gupfetch(); this.props.gupfetch();
this.cancelUploadImage = this.cancelUploadImage.bind(this); this.cancelUploadImage = this.cancelUploadImage.bind(this);
this.cropperRef = createRef(); this.cropperRef = createRef();
} }
// Upload上传之前函数 // Upload上传之前函数
beforeUpload = file => { beforeUpload = file => {
if(file.size > 2*1024*1024){ //bug-13496-liyuan if (file.size > 20 * 1024 * 1024) {
message.error("该图片超过大小,不支持上传");//bug 15215 //bug-13496-liyuan
message.error("该图片超过大小,不支持上传"); //bug 15215
return false; return false;
} }
if (this.props.disabled) { if (this.props.disabled) {
...@@ -92,7 +103,7 @@ class UploadImageCover extends Component { ...@@ -92,7 +103,7 @@ class UploadImageCover extends Component {
// message.error("该图片文件格式不支持(支持jpg、ipeg、png)"); // message.error("该图片文件格式不支持(支持jpg、ipeg、png)");
message.error("该图片文件格式不支持(支持jpg、jpeg、png)"); //bug-12706-liyuan message.error("该图片文件格式不支持(支持jpg、jpeg、png)"); //bug-12706-liyuan
return false; return false;
}//bug-12150-cwj end } //bug-12150-cwj end
var imgefile = window.URL var imgefile = window.URL
? window.URL.createObjectURL(file) ? window.URL.createObjectURL(file)
: window.webkitURL.createObjectURL(file); : window.webkitURL.createObjectURL(file);
...@@ -111,68 +122,91 @@ class UploadImageCover extends Component { ...@@ -111,68 +122,91 @@ class UploadImageCover extends Component {
//点击保存的函数,需要在这里进行压缩 //点击保存的函数,需要在这里进行压缩
saveImg = () => { saveImg = () => {
// 读取阿里云秘钥 let formData = new FormData();
const { param } = this.props; let randomNumber = Math.floor(Math.random() * 999999)
if (param !== null) { .toString()
.padStart(6, "0");
var file = dataURLtoFile(
this.state.imgbase.replace(" ", "").replace("\n", ""),
randomNumber
);
formData.append("file", file);
request({
url: `POST ${services.uploadsApi}`,
data: formData,
}).then(res => {
this.setState( this.setState(
{ {
uploadParams: { editImageModalVisible: false,
Filename:
param.dir +
"/" +
this.state.uid +
"." +
this.state.selectImgName.split(".")[1],
key:
param.dir +
"/" +
this.state.uid +
"." +
this.state.selectImgName.split(".")[1],
policy: param.policy,
OSSAccessKeyId: param.accessid,
success_action_status: "200",
signature: param.signature,
},
uploadAction: param.host,
hostAndDir: param.host + "/" + param.dir,
}, },
() => { () => {
let formData = new FormData(); this.props.getImgUrl(res.data);
for (let i in this.state.uploadParams) {
formData.append(i, this.state.uploadParams[i]);
}
var file = dataURLtoFile(this.state.imgbase, "2019009999999999");
formData.append("file", file);
const instance = axios.create({
withCredentials: false,
});
instance
.post(this.state.uploadAction, formData)
.then(res => {
console.log("ok", res);
if (res.status === 200) {
this.setState(
{
imgDoneSrc:
this.state.uploadAction +
"/" +
this.state.uploadParams.Filename,
editImageModalVisible: false,
},
() => {
this.props.getImgUrl(this.state.imgDoneSrc);
}
);
}
})
.catch(function(error) {
console.log("err", error.message);
});
} }
); );
} });
// 读取阿里云秘钥
// const { param } = this.props;
// if (param !== null) {
// this.setState(
// {
// uploadParams: {
// Filename:
// param.dir +
// "/" +
// this.state.uid +
// "." +
// this.state.selectImgName.split(".")[1],
// key:
// param.dir +
// "/" +
// this.state.uid +
// "." +
// this.state.selectImgName.split(".")[1],
// policy: param.policy,
// OSSAccessKeyId: param.accessid,
// success_action_status: "200",
// signature: param.signature,
// },
// uploadAction: param.host,
// hostAndDir: param.host + "/" + param.dir,
// },
// () => {
// let formData = new FormData();
// for (let i in this.state.uploadParams) {
// formData.append(i, this.state.uploadParams[i]);
// }
// var file = dataURLtoFile(this.state.imgbase, "2019009999999999");
// formData.append("file", file);
// const instance = axios.create({
// withCredentials: false,
// });
// instance
// .post(this.state.uploadAction, formData)
// .then(res => {
// console.log("ok", res);
// if (res.status === 200) {
// this.setState(
// {
// imgDoneSrc:
// this.state.uploadAction +
// "/" +
// this.state.uploadParams.Filename,
// editImageModalVisible: false,
// },
// () => {
// this.props.getImgUrl(this.state.imgDoneSrc);
// }
// );
// }
// })
// .catch(function(error) {
// console.log("err", error.message);
// });
// }
// );
// }
}; };
crop = e => { crop = e => {
// console.log(e); // console.log(e);
...@@ -225,7 +259,6 @@ class UploadImageCover extends Component { ...@@ -225,7 +259,6 @@ class UploadImageCover extends Component {
render() { render() {
let { imgbase, editImageModalVisible, srcCropper } = this.state; let { imgbase, editImageModalVisible, srcCropper } = this.state;
const uploadButton = ( const uploadButton = (
<div> <div>
<Icon type="plus" /> <Icon type="plus" />
...@@ -243,10 +276,10 @@ class UploadImageCover extends Component { ...@@ -243,10 +276,10 @@ class UploadImageCover extends Component {
showUploadList={false} //不以默认的列表显示 showUploadList={false} //不以默认的列表显示
listType="picture-card" //上传列表的内建样式,支持三种基本样式 text, picture 和 picture-card listType="picture-card" //上传列表的内建样式,支持三种基本样式 text, picture 和 picture-card
> >
{imgbase||this.props.details ? (//bug-12535-cwj {imgbase || this.props.details ? ( //bug-12535-cwj
<img <img
className="common-upload-img-display" className="common-upload-img-display"
src={imgbase||this.props.details}//bug-12535-cwj src={imgbase || this.props.details} //bug-12535-cwj
alt="avatar" alt="avatar"
style={{ width: "100%" }} style={{ width: "100%" }}
/> />
...@@ -313,7 +346,7 @@ class UploadImageCover extends Component { ...@@ -313,7 +346,7 @@ class UploadImageCover extends Component {
</div> </div>
<Cropper <Cropper
src={srcCropper} //图片路径,即是base64的值,在Upload上传的时候获取到的 src={srcCropper} //图片路径,即是base64的值,在Upload上传的时候获取到的
ref={(ref)=>this.cropperRef = ref} ref={ref => (this.cropperRef = ref)}
key={this.state.myRatio} key={this.state.myRatio}
style={{ height: 400, width: "100%" }} style={{ height: 400, width: "100%" }}
aspectRatio={ aspectRatio={
......
...@@ -534,7 +534,7 @@ ...@@ -534,7 +534,7 @@
"inputCaseTopicTip": "Please enter case subject!", "inputCaseTopicTip": "Please enter case subject!",
"caseCover": "Cover", "caseCover": "Cover",
"uploadCaseCoverTip": "Please upload the cover!", "uploadCaseCoverTip": "Please upload the cover!",
"caseCoverRequire": "Click '+' to add a photo. Size: 1125*675, with in 500k. jpg, png, and jpeg allowed", "caseCoverRequire": "Click '+' to add a photo. Size: 1125*900, with in 500k. jpg, png, and jpeg allowed",
"caseContent": "Content", "caseContent": "Content",
"caseContentTip": "Please upload the content!", "caseContentTip": "Please upload the content!",
"attachment": "Attachment", "attachment": "Attachment",
......
...@@ -521,7 +521,7 @@ ...@@ -521,7 +521,7 @@
"inputCaseTopicTip": "请输入作品主题!", "inputCaseTopicTip": "请输入作品主题!",
"caseCover": "作品封面", "caseCover": "作品封面",
"uploadCaseCoverTip": "请上传作品封面!", "uploadCaseCoverTip": "请上传作品封面!",
"caseCoverRequire": "点击“+”添加图片,图片最佳尺寸:1125*675,支持jpg、png、jpeg,大小500K以内", "caseCoverRequire": "点击“+”添加图片,图片最佳尺寸:1125*900,支持jpg、png、jpeg,大小500K以内",
"caseContent": "作品内容", "caseContent": "作品内容",
"caseContentTip": "请上传作品内容!", "caseContentTip": "请上传作品内容!",
"attachment": "附件", "attachment": "附件",
...@@ -1702,7 +1702,7 @@ ...@@ -1702,7 +1702,7 @@
"caseadmin108": "作品主题", "caseadmin108": "作品主题",
"caseadmin109": "请输入作品主题!", "caseadmin109": "请输入作品主题!",
"caseadmin110": "作品内容", "caseadmin110": "作品内容",
"caseadmin111": "添加图片,图片最佳尺寸:1125*675,支持jpg、png、jpeg,", "caseadmin111": "添加图片,图片最佳尺寸:1125*900,支持jpg、png、jpeg,",
"caseadmin112": "添加图片、视频、音频、文档及压缩包,每个文件最大为50M,每次最多上传9个文件", "caseadmin112": "添加图片、视频、音频、文档及压缩包,每个文件最大为50M,每次最多上传9个文件",
"caseadmin113": "提交审核", "caseadmin113": "提交审核",
"caseadmin114": "作品提醒", "caseadmin114": "作品提醒",
...@@ -2505,7 +2505,7 @@ ...@@ -2505,7 +2505,7 @@
"Statisitic31": "复制调研", "Statisitic31": "复制调研",
"Statisitic32": "选择调研", "Statisitic32": "选择调研",
"Statisitic33": "调研logo", "Statisitic33": "调研logo",
"Statisitic34": "图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg", "Statisitic34": "图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg",
"Statisitic35": "调研说明", "Statisitic35": "调研说明",
"Statisitic36": "调研备注", "Statisitic36": "调研备注",
"Statisitic37": "问题内容", "Statisitic37": "问题内容",
...@@ -2730,7 +2730,7 @@ ...@@ -2730,7 +2730,7 @@
"SystemActive1": "图片上传中", "SystemActive1": "图片上传中",
"SystemActive2": "上架时间", "SystemActive2": "上架时间",
"SystemActive3": "请上传小于500k的图片", "SystemActive3": "请上传小于500k的图片",
"SystemActive4": "请上传资源附件(支持格式jpeg、jpg、png,大小500k以内,建议尺寸:1125*675", "SystemActive4": "请上传资源附件(支持格式jpeg、jpg、png,大小500k以内,建议尺寸:1125*900",
"SystemActive5": "推荐活动内容不能为空", "SystemActive5": "推荐活动内容不能为空",
"SystemActive6": "推荐活动封面图不能为空", "SystemActive6": "推荐活动封面图不能为空",
"SystemActive7": "请填写模块名称", "SystemActive7": "请填写模块名称",
...@@ -2910,7 +2910,7 @@ ...@@ -2910,7 +2910,7 @@
"SystemNews3": "更换图片", "SystemNews3": "更换图片",
"SystemNews4": "封面logo", "SystemNews4": "封面logo",
"SystemNews5": "新建资讯", "SystemNews5": "新建资讯",
"SystemNews6": "请上传资源附件(支持格式jpeg、jpg、png,大小1m以内)建议尺寸:1125*675", "SystemNews6": "请上传资源附件(支持格式jpeg、jpg、png,大小1m以内)建议尺寸:1125*900",
"SystemNews7": "新闻必须上传logo", "SystemNews7": "新闻必须上传logo",
"SystemNews8": "文章名称", "SystemNews8": "文章名称",
"SystemNews9": "请输入文章名称", "SystemNews9": "请输入文章名称",
...@@ -3752,7 +3752,7 @@ ...@@ -3752,7 +3752,7 @@
"mycaselibrary25": "执行进度", "mycaselibrary25": "执行进度",
"mycaselibrary26": "图片大小超过10M", "mycaselibrary26": "图片大小超过10M",
"mycaselibrary27": "图片类型不允许", "mycaselibrary27": "图片类型不允许",
"mycaselibrary28": "图片最佳尺寸:1125*675,", "mycaselibrary28": "图片最佳尺寸:1125*900,",
"mycaselibrary29": "支持jpg、png、jpeg,大小10*1024k以内", "mycaselibrary29": "支持jpg、png、jpeg,大小10*1024k以内",
"mycaselibrary30": "关键词字数过多", "mycaselibrary30": "关键词字数过多",
"mycaselibrary31": "您未输入自定义关键词", "mycaselibrary31": "您未输入自定义关键词",
...@@ -4136,7 +4136,7 @@ ...@@ -4136,7 +4136,7 @@
"practiceText1": "请输入陪练名称(100字以内)", "practiceText1": "请输入陪练名称(100字以内)",
"practiceText2": "陪练名称最多可输入100字", "practiceText2": "陪练名称最多可输入100字",
"practiceText3": "(图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg,大小2M以内)", "practiceText3": "(图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg,大小2M以内)",
"practiceText4": "请输入训练介绍(500字以内)", "practiceText4": "请输入训练介绍(500字以内)",
"practiceText5": "请选择训练生效时段", "practiceText5": "请选择训练生效时段",
"practiceText6": "请选择考核生效时段", "practiceText6": "请选择考核生效时段",
......
...@@ -8,7 +8,8 @@ export default { ...@@ -8,7 +8,8 @@ export default {
//公共 //公共
common: { common: {
//用户查询域名 //用户查询域名
userUrl: `GET ${services.base}/system`, getUrl: `GET ${services.base}`,
postUrl: `POST ${services.base}`,
// videoUpload: `POST ${services.ossUrl}/video/upload`, // videoUpload: `POST ${services.ossUrl}/video/upload`,
}, },
}; };
export const ACTIVE_ACCOUNT = "ACTIVE_ACCOUNT"; export const ACTION_LIST = "ACTION_LIST";
export const COURSE_TIME = "COURSE_TIME"; export const PHB_CHART = "PHB_CHART";
export const COURSE_FINISH = "COURSE_FINISH"; export const DLL_DATA = "DLL_DATA";
export const TP_FINISH = "TP_FINISH"; export const LLL_DATA = "LLL_DATA";
export const ACCOUNT_TO_MONTH = "ACCOUNT_TO_MONTH"; export const HDL_MENU = "HDL_MENU";
export const ACCOUNT_TO_WEEK = "ACCOUNT_TO_WEEK"; export const HDL_DATA = "HDL_DATA";
export const ACCOUNT_TO_YESTERDAY = "ACCOUNT_TO_YESTERDAY"; export const ZLL_DATA = "ZLL_DATA";
export const ACCOUNT_READY_TASK = "ACCOUNT_READY_TASK"; export const ZLR_DATA = "ZLR_DATA";
export const USED_FUNCTIONS = "USED_FUNCTIONS"; export const WJ_DATA = "WJ_DATA";
export const LOGO_SITE = "LOGO_SITE"; export const TG_DATA = "TG_DATA";
export const LEVEL2_MENU = "LEVEL2_MENU";
export const TGR_DATA = "TGR_DATA";
export const TGR_DATA1 = "TGR_DATA1";
...@@ -2,187 +2,162 @@ import request from "@/util/request.js"; ...@@ -2,187 +2,162 @@ import request from "@/util/request.js";
import api from "../api"; import api from "../api";
import * as Types from "./actionTypes"; import * as Types from "./actionTypes";
const { common } = api; const { common } = api;
const { userUrl } = common; const { getUrl, postUrl } = common;
// 活跃用户比例 // 活跃用户比例
export function activeAccountNumber() { export function getActionList() {
const url = `${userUrl}/manage/dashboard/activeAccount`; const url = `${getUrl}/web-manage/manage/api/eventTrack/getTodayNum`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
}).then(res => { }).then(res => {
dispatch({ type: Types.ACTION_LIST, data: res.data });
dispatch({ type: Types.ACTIVE_ACCOUNT, activeAccount: res });
}); });
}; };
} }
export function getPhbChartList(data) {
// 学员访问总时长 const url = `${getUrl}/web-manage/manage/point/user/new/rank/list`;
export function courseTimeNumber(data, callback) {
const url = `${userUrl}/manage/dashboard/courseTime`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.PHB_CHART, data: res.data.records });
if (callback) {
callback(res);
}
}
dispatch({ type: Types.COURSE_TIME, courseTime: res });
}); });
}; };
} }
export function getDllData(data) {
// 完成课程 const url = `${getUrl}/web-manage/manage/api/eventTrack/getNumByType`;
export function courseFinishNumber(data, callback) {
const url = `${userUrl}/manage/dashboard/courseFinish`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.DLL_DATA, data: res.data });
if (callback) {
callback(res);
}
}
dispatch({ type: Types.COURSE_FINISH, courseFinish: res });
}); });
}; };
} }
export function getLllData(data) {
// 项目通过率 const url = `${getUrl}/web-manage/manage/api/eventTrack/queryNumByType`;
export function tpFinishNumber(data, callback) {
const url = `${userUrl}/manage/dashboard/tpFinish`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.LLL_DATA, data: res.data });
if (callback) {
callback(res);
}
}
dispatch({ type: Types.TP_FINISH, tpFinish: res });
}); });
}; };
} }
//互动量枚举
// 按月统计 export function getHdlMenu(data) {
export function accountToMonthNumber(data, callback) { const url = `${getUrl}/web-manage/manage/classify/childnode/find`;
const url = `${userUrl}/manage/dashboard/accountToMonth`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { let list = [];
if (callback) { if (res.data.length > 0) {
callback(res); list = res.data.filter(item => item.id != 0);
}
} }
dispatch({ type: Types.HDL_MENU, data: list });
dispatch({ type: Types.ACCOUNT_TO_MONTH, accountToMonth: res });
}); });
}; };
} }
//互动量枚举
// 按周统计 export function getLevel2Menu(data) {
export function accountToWeekNumber(data, callback) { const url = `${getUrl}/web-manage/manage/classify/childnode/find`;
const url = `${userUrl}/manage/dashboard/accountToWeek`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { let list = [];
if (callback) { if (res.data.length > 0) {
callback(res); list = res.data.filter(item => item.id != 0);
}
} }
dispatch({ type: Types.LEVEL2_MENU, data: list });
dispatch({ type: Types.ACCOUNT_TO_WEEK, accountToWeek: res });
}); });
}; };
} }
//互动量
// 按天统计 export function getHdlData(data) {
export function accountToYesterdayNumber(data, callback) { const url = `${getUrl}/web-manage/manage/api/eventTrack/queryNumByType`;
const url = `${userUrl}/manage/dashboard/accountYesterday`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.HDL_DATA, data: res.data });
if (callback) {
callback(res);
}
}
dispatch({ type: Types.ACCOUNT_TO_YESTERDAY, accountToYesterday: res });
}); });
}; };
} }
//专栏左侧
// 待办事项 export function getZllData(data) {
export function accountReadyTaskNumber(data, callback) { const url = `${getUrl}/web-manage/manage/api/eventTrack/queryDeptByType`;
const url = `${userUrl}/manage/dashboard/accountReadyTask`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.ZLL_DATA, data: res.data });
if (callback) {
callback(res);
}
}
dispatch({ type: Types.ACCOUNT_READY_TASK, accountReadyTask: res });
}); });
}; };
} }
//专栏右侧
// 常用功能 export function getZlrData(data) {
export function usedFunctionsNumber(data, callback) { const url = `${getUrl}/web-manage/manage/api/eventTrack/selectExamListBySta`;
const url = `${userUrl}/manage/dashboard/usedFunctions`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.ZLR_DATA, data: res.data });
if (callback) { });
callback(res); };
} }
} //问卷
export function getWjData(data) {
dispatch({ type: Types.USED_FUNCTIONS, usedFunctions: res }); const url = `${getUrl}/web-manage/manage/api/eventTrack/getNumByType`;
return dispatch => {
return request({
url,
data,
}).then(res => {
dispatch({ type: Types.WJ_DATA, data: res.data });
});
};
}
//投稿
export function getTgData(data) {
const url = `${getUrl}/web-manage/manage/api/eventTrack/getNumByType`;
return dispatch => {
return request({
url,
data,
}).then(res => {
dispatch({ type: Types.TG_DATA, data: res.data });
}); });
}; };
} }
//投稿折线
// 头像,站点获取 export function getTgrData(data) {
export function logoSiteNumber(data, callback) { const url = `${getUrl}/web-manage/manage/api/eventTrack/queryTgNumByDept`;
const url = `${userUrl}/manage/site/get`;
return dispatch => { return dispatch => {
return request({ return request({
url, url,
data, data,
}).then(res => { }).then(res => {
if (res.code == "1000") { dispatch({ type: Types.TGR_DATA, data: res.data });
if (callback) { let array = [];
callback(res); for (let index = 0; index < 4; index++) {
} let param = { month: "", data: [] };
param.month = res.data[0].eventTrackTypeNumVoList[index].subType + "月";
res.data.forEach(item => {
param.data.push(item.eventTrackTypeNumVoList[index].num);
});
array.unshift(param);
} }
dispatch({ type: Types.TGR_DATA1, data: array });
dispatch({ type: Types.LOGO_SITE, logoSite: res });
}); });
}; };
} }
import * as Types from "./actionTypes"; import * as Types from "./actionTypes";
const initialState = { const initialState = {
activeAccountList: {}, actionList: {},
courseTimeList: {}, pbhChartList: [],
courseFinishList: {}, dllData: [],
tpFinishList: {}, hdlMenu: [],
accountToMonthList: [], hdlData: [],
accountToWeekList: [], zllData: [],
accountToYesterdayList: [], zlrData: [],
accountReadyTaskList: {}, tgData: [],
usedFunctionsList: {}, wjData: [],
logoSiteList: {}, level2Menu: [],
tgrData: [],
tgrData1: [],
}; };
function homePage(state = initialState, action) { function homePage(state = initialState, action) {
switch (action.type) { switch (action.type) {
case Types.ACTIVE_ACCOUNT: case Types.ACTION_LIST:
return Object.assign({}, state, { return Object.assign({}, state, {
activeAccountList: action.activeAccount, actionList: action.data,
}); });
case Types.COURSE_TIME: case Types.PHB_CHART:
return Object.assign({}, state, { return Object.assign({}, state, {
courseTimeList: action.courseTime, pbhChartList: action.data,
}); });
case Types.COURSE_FINISH: case Types.DLL_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
courseFinishList: action.courseFinish, dllData: action.data,
}); });
case Types.TP_FINISH: case Types.LLL_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
tpFinishList: action.tpFinish, lllData: action.data,
}); });
case Types.ACCOUNT_TO_MONTH: case Types.HDL_MENU:
return Object.assign({}, state, { return Object.assign({}, state, {
accountToMonthList: action.accountToMonth, hdlMenu: action.data,
}); });
case Types.ACCOUNT_TO_WEEK: case Types.HDL_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
accountToWeekList: action.accountToWeek, hdlData: action.data,
}); });
case Types.ACCOUNT_TO_YESTERDAY: case Types.ZLL_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
accountToYesterdayList: action.accountToYesterday, zllData: action.data,
}); });
case Types.ACCOUNT_READY_TASK: case Types.ZLR_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
accountReadyTaskList: action.accountReadyTask, zlrData: action.data,
}); });
case Types.USED_FUNCTIONS: case Types.TG_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
usedFunctionsList: action.usedFunctions, tgData: action.data,
}); });
case Types.LOGO_SITE: case Types.WJ_DATA:
return Object.assign({}, state, { return Object.assign({}, state, {
logoSiteList: action.logoSite, wjData: action.data,
});
case Types.LEVEL2_MENU:
return Object.assign({}, state, {
level2Menu: action.data,
});
case Types.TGR_DATA:
return Object.assign({}, state, {
tgrData: action.data,
});
case Types.TGR_DATA1:
return Object.assign({}, state, {
tgrData1: action.data,
}); });
} }
return state; return state;
......
...@@ -598,4 +598,22 @@ ...@@ -598,4 +598,22 @@
// } // }
}
:global{
.ant-input-group-addon{
z-index: 999;
padding: 0;
border: none;
width: 80px;
height: 30px;
display: block;
position: absolute;
right: 0;
top:-2px;
background: transparent;
& img{
width: 80px;
height: 30px;
}
}
} }
\ No newline at end of file
...@@ -14,5 +14,6 @@ export default { ...@@ -14,5 +14,6 @@ export default {
getSkin: `GET ${services.base}/web-student/api/portal/theme/color/public/get`, getSkin: `GET ${services.base}/web-student/api/portal/theme/color/public/get`,
getAssToken: `GET ${services.systemManage}/account/access/community`, getAssToken: `GET ${services.systemManage}/account/access/community`,
getCode: `${services.systemApi}/public/getCaptcha`,
}, },
}; };
...@@ -7,7 +7,14 @@ import React from "react"; ...@@ -7,7 +7,14 @@ import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Form, Input, message } from "antd"; import { Button, Form, Input, message } from "antd";
import style from "./Style/login.less"; import style from "./Style/login.less";
import { exfetchR, getSkinData, toAssToken } from "./redux/actions"; import api from "./api";
const { common } = api;
import {
exfetchR,
getSkinData,
toAssToken,
getLoginCode,
} from "./redux/actions";
import commonFunc from "@/util/commonFunc"; import commonFunc from "@/util/commonFunc";
import SelectLang from "@/common/Layout/Header/SelectLang"; import SelectLang from "@/common/Layout/Header/SelectLang";
{ {
...@@ -24,12 +31,18 @@ const companySiteCode = `${commonFunc.companyCode}/${commonFunc.siteCode}`; ...@@ -24,12 +31,18 @@ const companySiteCode = `${commonFunc.companyCode}/${commonFunc.siteCode}`;
const shenWanHongYuanCode = "aegonthtf/home"; const shenWanHongYuanCode = "aegonthtf/home";
class Login extends React.Component { class Login extends React.Component {
constructor(props) {
super(props);
this.state = {
captchaKey: 1,
};
}
onPressEnter = e => { onPressEnter = e => {
this.handleSubmit(e); this.handleSubmit(e);
}; };
componentDidMount() { componentDidMount() {
const { getSkinData } = this.props; const { getSkinData, getLoginCode } = this.props;
getSkinData(res => { getSkinData(res => {
console.log("primary-color:", res); console.log("primary-color:", res);
document.documentElement.style.setProperty( document.documentElement.style.setProperty(
...@@ -37,6 +50,7 @@ class Login extends React.Component { ...@@ -37,6 +50,7 @@ class Login extends React.Component {
res.data.themeColor res.data.themeColor
); );
}); });
this.getCaptchaKey();
} }
generateCharacter(n) { generateCharacter(n) {
...@@ -92,6 +106,12 @@ class Login extends React.Component { ...@@ -92,6 +106,12 @@ class Login extends React.Component {
date = moment(new Date()).format("YYYYMMDD"); date = moment(new Date()).format("YYYYMMDD");
return date; return date;
} }
getCaptchaKey() {
let randomNumber = Math.floor(Math.random() * 999999)
.toString()
.padStart(6, "0");
this.setState({ captchaKey: randomNumber });
}
// 提交登录按钮发送给后台json // 提交登录按钮发送给后台json
handleSubmit = e => { handleSubmit = e => {
...@@ -147,8 +167,11 @@ class Login extends React.Component { ...@@ -147,8 +167,11 @@ class Login extends React.Component {
password, password,
salt: salt, salt: salt,
sign: md5(sign), sign: md5(sign),
captchaVal: values.captchaVal,
captchaKey: this.state.captchaKey,
languageCode: sessionStorage.getItem("lang") || null, //用户选择的语种,否则为null languageCode: sessionStorage.getItem("lang") || null, //用户选择的语种,否则为null
}; };
console.log(parms, 1111);
// let data = { // let data = {
// account: String(values.account).trim(), // account: String(values.account).trim(),
...@@ -225,7 +248,7 @@ class Login extends React.Component { ...@@ -225,7 +248,7 @@ class Login extends React.Component {
<div> <div>
<div className={style.imgDiv}> <div className={style.imgDiv}>
<img <img
src={require("./imgages/loginleft1.jpg")} src={require("./imgages/loginleft2.png")}
// style={{ height: "276px" }} // style={{ height: "276px" }}
// style={{ height: "552px" }} // style={{ height: "552px" }}
className={style.contentImg} className={style.contentImg}
...@@ -271,6 +294,31 @@ class Login extends React.Component { ...@@ -271,6 +294,31 @@ class Login extends React.Component {
/> />
)} )}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="验证码" hasFeedback>
{getFieldDecorator("captchaVal", {
rules: [
{
required: true,
whitespace: true,
message: "请填验证码",
// validator: this.validateToNextPassword,
},
],
})(
<Input
placeholder="请输入验证码"
maxLength={4}
addonAfter={
<img
src={`${common.getCode}?companyCode=zhdj&siteCode=edu&captchaKey=${this.state.captchaKey}`}
onClick={() => {
this.getCaptchaKey();
}}
></img>
}
/>
)}
</FormItem>
<FormItem className={style.loginBtn}> <FormItem className={style.loginBtn}>
<Button type="primary" onClick={this.handleSubmit}> <Button type="primary" onClick={this.handleSubmit}>
登录 登录
...@@ -304,6 +352,7 @@ function mapDispatchToProps(dispatch) { ...@@ -304,6 +352,7 @@ function mapDispatchToProps(dispatch) {
exfetchR: (data, cb) => dispatch(exfetchR(data, cb)), exfetchR: (data, cb) => dispatch(exfetchR(data, cb)),
getSkinData: cb => dispatch(getSkinData(cb)), getSkinData: cb => dispatch(getSkinData(cb)),
toAssToken: (data, cb) => dispatch(toAssToken(data, cb)), toAssToken: (data, cb) => dispatch(toAssToken(data, cb)),
getLoginCode: (data, cb) => dispatch(getLoginCode(data, cb)),
}; };
} }
......
// 登录和checkToken // 登录和checkToken
export const SIGN_FORM = "SIGN_FORM"; export const SIGN_FORM = "SIGN_FORM";
//获取站点默认配色 //获取站点默认配色
export const CHANGE_SKIN = "CHANGE_SKIN" export const CHANGE_SKIN = "CHANGE_SKIN";
//获取站点默认配色 //获取站点默认配色
export const SET_FLAG = "SET_FLAG" export const SET_FLAG = "SET_FLAG";
export const LOGIN_CODE = "LOGIN_CODE";
export const LOGIN_KEY = "LOGIN_KEY";
...@@ -10,30 +10,29 @@ import { set as setGlobalData } from "@/util/globalData.js"; ...@@ -10,30 +10,29 @@ import { set as setGlobalData } from "@/util/globalData.js";
import * as Types from "./actionTypes"; import * as Types from "./actionTypes";
const { common } = api; const { common } = api;
const { login, checkToken,getSkin ,getAssToken } = common; const { login, checkToken, getSkin, getAssToken, getCode } = common;
const that = this const that = this;
export function getSkinData(callback){ export function getSkinData(callback) {
let url = getSkin; let url = getSkin;
return dispatch => { return dispatch => {
return request({ return request({
url url,
}).then(res => { }).then(res => {
if (res.code==1000) { if (res.code == 1000) {
let companyCode = location.pathname.split("/")[1]; let companyCode = location.pathname.split("/")[1];
let siteCode = location.pathname.split("/")[2]; let siteCode = location.pathname.split("/")[2];
// 站点code // 站点code
window.sessionStorage.setItem("auxiliarColor", res.data.auxiliarColor); window.sessionStorage.setItem("auxiliarColor", res.data.auxiliarColor);
window.sessionStorage.setItem("themeColor", res.data.themeColor); window.sessionStorage.setItem("themeColor", res.data.themeColor);
window.sessionStorage.setItem("skinId",res.data.id); window.sessionStorage.setItem("skinId", res.data.id);
// 更新菜单和用户信息 // 更新菜单和用户信息
dispatch({ type: Types.CHANGE_SKIN}); dispatch({ type: Types.CHANGE_SKIN });
} }
if(callback){ if (callback) {
callback(res); callback(res);
} }
}); });
}; };
} }
export function exfetchR(data, cb, check) { export function exfetchR(data, cb, check) {
// 登录 // 登录
...@@ -53,35 +52,35 @@ export function exfetchR(data, cb, check) { ...@@ -53,35 +52,35 @@ export function exfetchR(data, cb, check) {
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
//只有社群的话直接滚走去社群 //只有社群的话直接滚走去社群
if(res.data.isOnlyCommunity){ if (res.data.isOnlyCommunity) {
sessionStorage.setItem("mgtk",res.data.Authorization) sessionStorage.setItem("mgtk", res.data.Authorization);
return cb(res) return cb(res);
}else{ } else {
if (cb) { if (cb) {
cb(res); cb(res);
} }
// 登录 // 登录
if (!check) { if (!check) {
// 临时设置语言,后期需要根据选择语言更改
setGlobalData("language", "zh-CN");
// 站点code
setGlobalData("companyCode", location.pathname.split("/")[1]);
setGlobalData("siteCode", location.pathname.split("/")[2]);
// 存储token
// cookie.save("token", res.data.Authorization);
sessionStorage.setItem("mgtk", res.data.Authorization);
// cookie.save("token", res.data.Authorization);
}
// 任意进入
// 临时设置语言,后期需要根据选择语言更改 // 临时设置语言,后期需要根据选择语言更改
setGlobalData("language", "zh-CN"); setGlobalData("language", "zh-CN");
// cookie.save("userName", res.data.userInfo.fullName);//bug-12952-cwj
sessionStorage.setItem("userName", res.data.userInfo.fullName);
// 站点code // 站点code
setGlobalData("companyCode", location.pathname.split("/")[1]); setGlobalData("companyCode", location.pathname.split("/")[1]);
setGlobalData("siteCode", location.pathname.split("/")[2]); setGlobalData("siteCode", location.pathname.split("/")[2]);
// 存储token // 更新菜单和用户信息
// cookie.save("token", res.data.Authorization); dispatch({ type: Types.SIGN_FORM, userLogin: res.data });
sessionStorage.setItem("mgtk",res.data.Authorization)
// cookie.save("token", res.data.Authorization);
}
// 任意进入
// 临时设置语言,后期需要根据选择语言更改
setGlobalData("language", "zh-CN");
// cookie.save("userName", res.data.userInfo.fullName);//bug-12952-cwj
sessionStorage.setItem("userName",res.data.userInfo.fullName)
// 站点code
setGlobalData("companyCode", location.pathname.split("/")[1]);
setGlobalData("siteCode", location.pathname.split("/")[2]);
// 更新菜单和用户信息
dispatch({ type: Types.SIGN_FORM, userLogin: res.data });
} }
} }
}); });
...@@ -98,18 +97,18 @@ export function toAssToken(data, cb, check) { ...@@ -98,18 +97,18 @@ export function toAssToken(data, cb, check) {
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
//得到token //得到token
const assToken = res.data const assToken = res.data;
if(location.host.includes("localhost")){ if (location.host.includes("localhost")) {
//跳转 //跳转
window.location.href=`http://localhost:7000/login?token=${assToken}` window.location.href = `http://localhost:7000/login?token=${assToken}`;
}else if(window.location.host.includes("dev")){ } else if (window.location.host.includes("dev")) {
window.location.href=`http://dev.association-admin.kmelearning.com/login?token=${assToken}` window.location.href = `http://dev.association-admin.kmelearning.com/login?token=${assToken}`;
}else if(window.location.host.includes("test")){ } else if (window.location.host.includes("test")) {
window.location.href=`http://test.association-admin.kmelearning.com/login?token=${assToken}` window.location.href = `http://test.association-admin.kmelearning.com/login?token=${assToken}`;
}else if(window.location.host.includes("uat")){ } else if (window.location.host.includes("uat")) {
window.location.href=`http://uat.association-admin.kmelearning.com/login?token=${assToken}` window.location.href = `http://uat.association-admin.kmelearning.com/login?token=${assToken}`;
}else { } else {
window.location.href=`https://association-admin.kmelearning.com/login?token=${assToken}` window.location.href = `https://association-admin.kmelearning.com/login?token=${assToken}`;
} }
} }
}); });
...@@ -126,7 +125,21 @@ export function toAssToken(data, cb, check) { ...@@ -126,7 +125,21 @@ export function toAssToken(data, cb, check) {
// } // }
// //
// } // }
export function getLoginCode(data, cb, check) {
// 派发请求
let randomNumber = Math.floor(Math.random() * 999999)
.toString()
.padStart(6, "0");
let url = getCode;
return dispatch => {
return request({ url, data: { ...data, captchaKey: randomNumber } }).then(
res => {
dispatch({ type: Types.LOGIN_CODE, data: res });
dispatch({ type: Types.LOGIN_KEY, data: randomNumber });
}
);
};
}
export function setCollapsedFlag(data, cb) { export function setCollapsedFlag(data, cb) {
return dispatch => { return dispatch => {
......
...@@ -8,6 +8,8 @@ const initialState = { ...@@ -8,6 +8,8 @@ const initialState = {
// siteData: [mockMenu], // siteData: [mockMenu],
siteData: [], siteData: [],
collapsedFlag: false, collapsedFlag: false,
loginCode: "",
loginKey: "",
}; };
function login(state = initialState, action) { function login(state = initialState, action) {
...@@ -23,7 +25,16 @@ function login(state = initialState, action) { ...@@ -23,7 +25,16 @@ function login(state = initialState, action) {
collapsedFlag: action.collapsedFlag, collapsedFlag: action.collapsedFlag,
// siteData: state.siteData, // siteData: state.siteData,
}); });
case Types.LOGIN_CODE:
return Object.assign({}, state, {
loginCode: action.data,
// siteData: state.siteData,
});
case Types.LOGIN_KEY:
return Object.assign({}, state, {
loginKey: action.data,
// siteData: state.siteData,
});
} }
return state; return state;
} }
......
...@@ -199,6 +199,7 @@ function mapStateToProps(state, ownProps) { ...@@ -199,6 +199,7 @@ function mapStateToProps(state, ownProps) {
icon: item.node.icon, icon: item.node.icon,
// activeIcon: item.node.activeIcon, // activeIcon: item.node.activeIcon,
menuType: item.node.menuType, menuType: item.node.menuType,
url: item.node.url,
}); });
// //
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
} }
.content { .content {
background-color: #F0F2F5; background-color: #f8f9ff;
padding: 16px; padding: 16px;
padding-top: 76px; padding-top: 76px;
min-height: ~"calc(100% - 72px)"; min-height: ~"calc(100% - 0px)";
} }
.contentnopadding { .contentnopadding {
background-color: #F0F2F5; background-color: #f8f9ff;
min-height: ~"calc(100% - 72px)"; min-height: ~"calc(100% - 0px)";
} }
.container { .container {
......
...@@ -157,7 +157,8 @@ class Lookcase extends Component { ...@@ -157,7 +157,8 @@ class Lookcase extends Component {
index: i, index: i,
}); });
}); });
if (list && list.length) { //bug 14763 zj if (list && list.length) {
//bug 14763 zj
res.data.classifyListVOList.map((v, i) => { res.data.classifyListVOList.map((v, i) => {
if (list[i].level == 1) { if (list[i].level == 1) {
v.selectList.push(list[i].classifyId); v.selectList.push(list[i].classifyId);
...@@ -196,12 +197,12 @@ class Lookcase extends Component { ...@@ -196,12 +197,12 @@ class Lookcase extends Component {
index, index,
}; };
} }
if (this.state.classlist) { //bug 14763 zj if (this.state.classlist) {
//bug 14763 zj
this.state.classlist.splice(index, 1, list); this.state.classlist.splice(index, 1, list);
} else { } else {
this.state.classlist.push(list) this.state.classlist.push(list);
} }
} }
handleSearch(type) { handleSearch(type) {
const htmlContent = this.state.editorContent; const htmlContent = this.state.editorContent;
...@@ -508,7 +509,7 @@ class Lookcase extends Component { ...@@ -508,7 +509,7 @@ class Lookcase extends Component {
info.file.uid + info.file.uid +
"." + "." +
info.file.name.split(".")[ info.file.name.split(".")[
info.file.name.split(".").length - 1 info.file.name.split(".").length - 1
], ],
}, },
]), ]),
...@@ -596,36 +597,35 @@ class Lookcase extends Component { ...@@ -596,36 +597,35 @@ class Lookcase extends Component {
{/* {id?data&&<MUpload {...uploadProps} ref={(c) =>this.validate = c} /> : {/* {id?data&&<MUpload {...uploadProps} ref={(c) =>this.validate = c} /> :
<MUpload {...uploadProps} ref={(c) =>this.validate = c} /> } */} <MUpload {...uploadProps} ref={(c) =>this.validate = c} /> } */}
<FormItem {...formItemLayout} label="作品封面"> <FormItem {...formItemLayout} label="作品封面">
{data.productCover == 80 ? {data.productCover == 80
getFieldDecorator("caseLogo", { ? getFieldDecorator("caseLogo", {
rules: [ rules: [
{ {
required: true, required: true,
message: "请上传作品封面", message: "请上传作品封面",
}, },
], ],
initialValue: data ? data.logoUrl : null, initialValue: data ? data.logoUrl : null,
})( })(
<UploadImageCover <UploadImageCover
details={data ? data.logoUrl : null} details={data ? data.logoUrl : null}
getImgUrl={this.getImgUrl} getImgUrl={this.getImgUrl}
preRatio={["5/3"]} preRatio={["5/4"]}
maxSize={500} maxSize={500}
extra="图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg" //task-1110-cwj 删除500k extra="图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg" //task-1110-cwj 删除500k
/> />
) : )
getFieldDecorator("caseLogo", { : getFieldDecorator("caseLogo", {
initialValue: data ? data.logoUrl : null, initialValue: data ? data.logoUrl : null,
})( })(
<UploadImageCover <UploadImageCover
details={data ? data.logoUrl : null} details={data ? data.logoUrl : null}
getImgUrl={this.getImgUrl} getImgUrl={this.getImgUrl}
preRatio={["5/3"]} preRatio={["5/4"]}
maxSize={500} maxSize={500}
extra="图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg" //task-1110-cwj 删除500k extra="图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg" //task-1110-cwj 删除500k
/> />
) )}
}
</FormItem> </FormItem>
<FormItem <FormItem
...@@ -651,20 +651,21 @@ class Lookcase extends Component { ...@@ -651,20 +651,21 @@ class Lookcase extends Component {
{data && data.textEditType == 2 ? ( {data && data.textEditType == 2 ? (
<div dangerouslySetInnerHTML={{ __html: data.content }} /> <div dangerouslySetInnerHTML={{ __html: data.content }} />
) : ( ) : (
<div style={{ border: "1px solid #ccc" }}> <div style={{ border: "1px solid #ccc" }}>
{/* <CaseEditor {/* <CaseEditor
refreshEditor={this.state.refreshEditor} refreshEditor={this.state.refreshEditor}
initValue={this.state.editorContent} initValue={this.state.editorContent}
onChange={this.handleEditorChange2} onChange={this.handleEditorChange2}
uploadParam={this.props.param} uploadParam={this.props.param}
/> 旧的富文本编辑器 */} /> 旧的富文本编辑器 */}
{data.id && {data.id && (
<Editor <Editor
cbReceiver={this.handleEditorChange2} cbReceiver={this.handleEditorChange2}
importContent={data.content} importContent={data.content}
/>} />
</div> )}
)} </div>
)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="附件(最多支持9个附件)"> <FormItem {...formItemLayout} label="附件(最多支持9个附件)">
{getFieldDecorator("upload", { {getFieldDecorator("upload", {
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
Progress, Progress,
message, message,
Dropdown, Dropdown,
Menu Menu,
} from "antd"; } from "antd";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import func from "@/util/commonFunc"; import func from "@/util/commonFunc";
...@@ -116,7 +116,7 @@ class CourseDetail extends Component { ...@@ -116,7 +116,7 @@ class CourseDetail extends Component {
baseInfo.description = courseInfo.courseVo.description; baseInfo.description = courseInfo.courseVo.description;
baseInfo.tags = oldTags; baseInfo.tags = oldTags;
baseInfo.courseType = courseInfo.courseVo.courseType; baseInfo.courseType = courseInfo.courseVo.courseType;
const info = this.handleTitle(courseInfo.courseVo.classifyName) const info = this.handleTitle(courseInfo.courseVo.classifyName);
_this.setState({ _this.setState({
baseInfo: baseInfo, baseInfo: baseInfo,
defaultUrl: courseInfo.courseVo.image, defaultUrl: courseInfo.courseVo.image,
...@@ -225,17 +225,16 @@ class CourseDetail extends Component { ...@@ -225,17 +225,16 @@ class CourseDetail extends Component {
}; };
if (_this.props.type === "edit") { if (_this.props.type === "edit") {
data.id = this.props.courseId; data.id = this.props.courseId;
saveCourseBasicInfo(data, (res) => { saveCourseBasicInfo(data, res => {
if (res.code == "1000") { if (res.code == "1000") {
message.success("保存成功"); message.success("保存成功");
_this.props.step(1, courseType); _this.props.step(1, courseType);
} }
}); });
} else { } else {
if (_this.props.courseId) { if (_this.props.courseId) {
data.id = _this.props.courseId; data.id = _this.props.courseId;
saveCourseBasicInfo(data, (res) => { saveCourseBasicInfo(data, res => {
if (res.code == "1000") { if (res.code == "1000") {
message.success("保存成功"); message.success("保存成功");
_this.props.step(1, courseType); _this.props.step(1, courseType);
...@@ -314,20 +313,30 @@ class CourseDetail extends Component { ...@@ -314,20 +313,30 @@ class CourseDetail extends Component {
this.props = null; this.props = null;
} }
displayRender = (label, selectedOptions) => { displayRender = (label, selectedOptions) => {
console.log("display: " + label, selectedOptions) console.log("display: " + label, selectedOptions);
const length = selectedOptions.length; const length = selectedOptions.length;
const showLabel = length === 0 ? label : const showLabel =
length === 1 ? selectedOptions[0].name : length === 0
length === 2 ? selectedOptions[0].name + "/" + selectedOptions[1].name : ? label
length === 3 ? selectedOptions[0].name + "/" + selectedOptions[1].name + "/" + selectedOptions[2].name : ""; : length === 1
? selectedOptions[0].name
: length === 2
? selectedOptions[0].name + "/" + selectedOptions[1].name
: length === 3
? selectedOptions[0].name +
"/" +
selectedOptions[1].name +
"/" +
selectedOptions[2].name
: "";
this.setState({ this.setState({
showRender: showLabel showRender: showLabel,
}) });
return showLabel; return showLabel;
} };
handleTitle = (title) => { handleTitle = title => {
const { classify } = this.props const { classify } = this.props;
console.log("classify", classify) console.log("classify", classify);
const items = title.split(","); const items = title.split(",");
var newTitle = ""; var newTitle = "";
classify.forEach(element => { classify.forEach(element => {
...@@ -342,18 +351,18 @@ class CourseDetail extends Component { ...@@ -342,18 +351,18 @@ class CourseDetail extends Component {
if (item.id === items[2]) { if (item.id === items[2]) {
newTitle += "/" + item.name; newTitle += "/" + item.name;
} }
}) });
} }
} }
}) });
} }
} }
}) });
// classify.forEach(element => { // classify.forEach(element => {
// console.log("element",element) // console.log("element",element)
// }); // });
return newTitle return newTitle;
} };
render() { render() {
const { defaultUrl, baseInfo } = this.state; const { defaultUrl, baseInfo } = this.state;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
...@@ -520,10 +529,10 @@ class CourseDetail extends Component { ...@@ -520,10 +529,10 @@ class CourseDetail extends Component {
<UploadImageCover <UploadImageCover
details={this.state.baseInfo.logo} details={this.state.baseInfo.logo}
getImgUrl={this.getImgUrl} getImgUrl={this.getImgUrl}
preRatio={["5/3"]} preRatio={["5/4"]}
maxSize={2 * 1024} //修改 任务 1087 此前为500K maxSize={2 * 1024} //修改 任务 1087 此前为500K
disabled={this.props.type === "look" ? true : false} disabled={this.props.type === "look" ? true : false}
extra="图片最佳尺寸:1125*675,比例为5:3,支持jpg、png、jpeg" extra="图片最佳尺寸:1125*900,比例为5:4,支持jpg、png、jpeg"
/> />
)} )}
</FormItem> </FormItem>
...@@ -612,7 +621,11 @@ class CourseDetail extends Component { ...@@ -612,7 +621,11 @@ class CourseDetail extends Component {
> >
<Button>返回</Button> <Button>返回</Button>
</Link> </Link>
<Button type="primary" onClick={this.baseInfoSubmit} style={{ margin: "0 16px" }}> <Button
type="primary"
onClick={this.baseInfoSubmit}
style={{ margin: "0 16px" }}
>
下一步 下一步
</Button> </Button>
</FormItem> </FormItem>
......
...@@ -321,7 +321,7 @@ class RegistrationForm extends React.Component { ...@@ -321,7 +321,7 @@ class RegistrationForm extends React.Component {
}, },
], ],
initialValue: name, initialValue: name,
})(<Input placeholder="请输入企业名称" />)} })(<Input placeholder="请输入企业名称" />)}
</FormItem> </FormItem>
{/*企业类型*/} {/*企业类型*/}
<FormItem label="企业类型" {...formItemLayout}> <FormItem label="企业类型" {...formItemLayout}>
...@@ -365,15 +365,16 @@ class RegistrationForm extends React.Component { ...@@ -365,15 +365,16 @@ class RegistrationForm extends React.Component {
<span>https://pc.kmelearning.com/{domain}/login</span> <span>https://pc.kmelearning.com/{domain}/login</span>
</FormItem> </FormItem>
{/*企业logo*/} {/*企业logo*/}
<FormItem <FormItem
// extra="(图片最佳尺寸:128*40,比例为5:3,支持jpg、png、jpeg,大小2M以内)" // extra="(图片最佳尺寸:128*40,比例为5:4,支持jpg、png、jpeg,大小2M以内)"
> >
{/*企业logo*/}
{/*企业logo*/} <UpLoad {...uploadProps1} ref={c => (this.validate = c)} />
<UpLoad {...uploadProps1} ref={c => (this.validate = c)} /> <span style={{ marginLeft: "25%" }}>
<span style={{marginLeft:"25%"}}>(图片最佳尺寸:128*40,比例为5:3,支持jpg、png、jpeg,大小2M以内)</span> (图片最佳尺寸:128*40,比例为5:4,支持jpg、png、jpeg,大小2M以内)
</FormItem> </span>
</FormItem>
{/*企业简介*/} {/*企业简介*/}
<FormItem {...formItemLayout} label="企业简介"> <FormItem {...formItemLayout} label="企业简介">
{getFieldDecorator("context", { {getFieldDecorator("context", {
...@@ -417,13 +418,13 @@ class RegistrationForm extends React.Component { ...@@ -417,13 +418,13 @@ class RegistrationForm extends React.Component {
{/*修改联系人*/} {/*修改联系人*/}
{/*<h1 style={{ fontSize: "16px", margin: "0 0 12px 0" }}>企业联系人</h1>*/} {/*<h1 style={{ fontSize: "16px", margin: "0 0 12px 0" }}>企业联系人</h1>*/}
{/*<Table*/} {/*<Table*/}
{/*loading={this.state.loading}*/} {/*loading={this.state.loading}*/}
{/*columns={userColumns}*/} {/*columns={userColumns}*/}
{/*pagination={false}*/} {/*pagination={false}*/}
{/*dataSource={contactorVOs}*/} {/*dataSource={contactorVOs}*/}
{/*rowClassName={record => {*/} {/*rowClassName={record => {*/}
{/*return record.editable ? styles.editable : "";*/} {/*return record.editable ? styles.editable : "";*/}
{/*}}*/} {/*}}*/}
{/*/>*/} {/*/>*/}
</Form> </Form>
<div <div
...@@ -433,10 +434,12 @@ class RegistrationForm extends React.Component { ...@@ -433,10 +434,12 @@ class RegistrationForm extends React.Component {
marginTop: "30px", marginTop: "30px",
}} }}
> >
<Button onClick={hideModal}> <Button onClick={hideModal}>取消</Button>
取消 <Button
</Button> style={{ marginLeft: 15 }}
<Button style={{ marginLeft: 15 }} type="primary" onClick={() => this.handleSubmit()}> type="primary"
onClick={() => this.handleSubmit()}
>
保存 保存
</Button> </Button>
</div> </div>
......
...@@ -50,8 +50,8 @@ class Company extends Component { ...@@ -50,8 +50,8 @@ class Company extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
name: '', name: "",
value: '', value: "",
pagesize: 5, pagesize: 5,
visible1: false, visible1: false,
modal2Visible: false, modal2Visible: false,
...@@ -61,7 +61,7 @@ class Company extends Component { ...@@ -61,7 +61,7 @@ class Company extends Component {
data: [], data: [],
logourl: "", logourl: "",
pages: {}, pages: {},
_status: '', _status: "",
current: "1", current: "1",
pageSize: "10", pageSize: "10",
}; };
...@@ -154,7 +154,7 @@ class Company extends Component { ...@@ -154,7 +154,7 @@ class Company extends Component {
componentDidMount() { componentDidMount() {
const { companyList } = this.props; const { companyList } = this.props;
// 企业列表action // 企业列表action
companyList({ pageNo: "1", pageSize: "10"}); companyList({ pageNo: "1", pageSize: "10" });
} }
// 显示弹窗 // 显示弹窗
...@@ -233,7 +233,8 @@ class Company extends Component { ...@@ -233,7 +233,8 @@ class Company extends Component {
getGlobalData("companyCode") + getGlobalData("companyCode") +
"/" + "/" +
getGlobalData("siteCode") + getGlobalData("siteCode") +
"/index/operating/editCompany?id="+record.key "/index/operating/editCompany?id=" +
record.key
); );
// this.props.companyGet({ companyId: record.key }, res => { // this.props.companyGet({ companyId: record.key }, res => {
...@@ -275,10 +276,10 @@ class Company extends Component { ...@@ -275,10 +276,10 @@ class Company extends Component {
const { companyList } = this.props; const { companyList } = this.props;
const { name, _status } = this.state; const { name, _status } = this.state;
const pages = { pageNo: 1, pageSize: 10 }; const pages = { pageNo: 1, pageSize: 10 };
let companyJson = '' let companyJson = "";
if(_status === '1'){ if (_status === "1") {
companyJson = { name, ...pages }; companyJson = { name, ...pages };
}else{ } else {
companyJson = { name, status: _status, ...pages }; companyJson = { name, status: _status, ...pages };
} }
...@@ -489,13 +490,13 @@ class Company extends Component { ...@@ -489,13 +490,13 @@ class Company extends Component {
onShowSizeChange(current, pageSize) { onShowSizeChange(current, pageSize) {
//bug-12232-jmy 分页bug //bug-12232-jmy 分页bug
that.setState({ current, pageSize }); that.setState({ current, pageSize });
if(that.state._status === '1'){ if (that.state._status === "1") {
companyList({ companyList({
pageNo: current, pageNo: current,
pageSize, pageSize,
name, name,
}); });
}else{ } else {
companyList({ companyList({
pageNo: current, pageNo: current,
pageSize, pageSize,
...@@ -507,13 +508,13 @@ class Company extends Component { ...@@ -507,13 +508,13 @@ class Company extends Component {
onChange(current, pageSize) { onChange(current, pageSize) {
// //
that.setState({ current, pageSize }); that.setState({ current, pageSize });
if(that.state._status === '1'){ if (that.state._status === "1") {
companyList({ companyList({
pageNo: current, pageNo: current,
pageSize, pageSize,
name, name,
}); });
}else{ } else {
companyList({ companyList({
pageNo: current, pageNo: current,
pageSize, pageSize,
...@@ -669,38 +670,38 @@ class Company extends Component { ...@@ -669,38 +670,38 @@ class Company extends Component {
/> />
{/* 展示头部 */} {/* 展示头部 */}
{/*<div className={styles.list_btn}>*/} {/*<div className={styles.list_btn}>*/}
{/*<div>*/} {/*<div>*/}
{/*<Input*/} {/*<Input*/}
{/*addonBefore="企业名称"*/} {/*addonBefore="企业名称"*/}
{/*placeholder="请输入企业名称"*/} {/*placeholder="请输入企业名称"*/}
{/*style={{ width: 250, marginRight: 10 }}*/} {/*style={{ width: 250, marginRight: 10 }}*/}
{/*onKeyDown={this.getExamKeyword}*/} {/*onKeyDown={this.getExamKeyword}*/}
{/*onChange={this.handleGetValue}*/} {/*onChange={this.handleGetValue}*/}
{/*/>*/} {/*/>*/}
{/*<Select*/} {/*<Select*/}
{/*defaultValue="启用"*/} {/*defaultValue="启用"*/}
{/*style={{ width: 120 }}*/} {/*style={{ width: 120 }}*/}
{/*onChange={this.handleGetState}*/} {/*onChange={this.handleGetState}*/}
{/*>*/} {/*>*/}
{/*<Option value="2">启用</Option>*/} {/*<Option value="2">启用</Option>*/}
{/*<Option value="3">停用</Option>*/} {/*<Option value="3">停用</Option>*/}
{/*</Select>*/} {/*</Select>*/}
{/*<Button*/} {/*<Button*/}
{/*type="primary"*/} {/*type="primary"*/}
{/*className="company-primary"*/} {/*className="company-primary"*/}
{/*onClick={this.handleSearch}*/} {/*onClick={this.handleSearch}*/}
{/*style={{ marginLeft: 10 }}*/} {/*style={{ marginLeft: 10 }}*/}
{/*>*/} {/*>*/}
{/*查询*/} {/*查询*/}
{/*</Button>*/} {/*</Button>*/}
{/*/!*<Button*!/*/} {/*/!*<Button*!/*/}
{/*/!*type="primary"*!/*/} {/*/!*type="primary"*!/*/}
{/*/!*onClick={() => this.open()}*!/*/} {/*/!*onClick={() => this.open()}*!/*/}
{/*/!*style={{ marginLeft: 10 }}*!/*/} {/*/!*style={{ marginLeft: 10 }}*!/*/}
{/*/!*>*!/*/} {/*/!*>*!/*/}
{/*/!*新增企业*!/*/} {/*/!*新增企业*!/*/}
{/*/!*</Button>*!/*/} {/*/!*</Button>*!/*/}
{/*</div>*/} {/*</div>*/}
{/*</div>*/} {/*</div>*/}
{/* 企业列表 */} {/* 企业列表 */}
<Table <Table
...@@ -762,7 +763,7 @@ class Company extends Component { ...@@ -762,7 +763,7 @@ class Company extends Component {
message: "站点名称最长不可超过60个字", message: "站点名称最长不可超过60个字",
}, },
], ],
})(<Input placeholder="请输入企业名称"/>)} })(<Input placeholder="请输入企业名称" />)}
</FormItem> </FormItem>
{/*企业类型*/} {/*企业类型*/}
<FormItem <FormItem
...@@ -819,13 +820,14 @@ class Company extends Component { ...@@ -819,13 +820,14 @@ class Company extends Component {
/> />
)} )}
</FormItem> </FormItem>
<FormItem <FormItem
// extra="(图片最佳尺寸:128*40,比例为5:3,支持jpg、png、jpeg,大小2M以内)" // extra="(图片最佳尺寸:128*40,比例为5:4,支持jpg、png、jpeg,大小2M以内)"
> >
{/*企业logo*/}
{/*企业logo*/} <UpLoad {...uploadProps1} ref={c => (this.validate = c)} />
<UpLoad {...uploadProps1} ref={c => (this.validate = c)} /> <span style={{ marginLeft: "25%" }}>
<span style={{marginLeft:"25%"}}>(图片最佳尺寸:128*40,比例为53,支持jpgpngjpeg,大小2M以内)</span> (图片最佳尺寸:128*40,比例为54,支持jpgpngjpeg,大小2M以内)
</span>
</FormItem> </FormItem>
{/*企业简介*/} {/*企业简介*/}
<FormItem {...formItemLayout} label="企业简介"> <FormItem {...formItemLayout} label="企业简介">
...@@ -872,12 +874,12 @@ class Company extends Component { ...@@ -872,12 +874,12 @@ class Company extends Component {
</Form> </Form>
{/*设置联系人*/} {/*设置联系人*/}
{/*<Button*/} {/*<Button*/}
{/*style={{ marginTop: 16, marginBottom: 8, display: "block" }}*/} {/*style={{ marginTop: 16, marginBottom: 8, display: "block" }}*/}
{/*type="primary"*/} {/*type="primary"*/}
{/*onClick={this.newMember}*/} {/*onClick={this.newMember}*/}
{/*icon="plus"*/} {/*icon="plus"*/}
{/*>*/} {/*>*/}
{/*新增成员*/} {/*新增成员*/}
{/*</Button>*/} {/*</Button>*/}
{this.state.flag ? ( {this.state.flag ? (
<Table <Table
...@@ -897,7 +899,11 @@ class Company extends Component { ...@@ -897,7 +899,11 @@ class Company extends Component {
> >
取消 取消
</Button> </Button>
<Button style={{ marginLeft: 15 }} type="primary" onClick={this.handleSubmit}> <Button
style={{ marginLeft: 15 }}
type="primary"
onClick={this.handleSubmit}
>
保存 保存
</Button> </Button>
</div> </div>
......
...@@ -753,7 +753,7 @@ class AlbumStatisticts extends React.Component { ...@@ -753,7 +753,7 @@ class AlbumStatisticts extends React.Component {
return ( return (
<div className="album-statistics-body" style={{ padding: 10 }}> <div className="album-statistics-body" style={{ padding: 10 }}>
<Breadcrumb title="专辑统计"/> <Breadcrumb title="专辑统计" />
<div> <div>
<span style={{ marginRight: 20 }}>时间段</span> <span style={{ marginRight: 20 }}>时间段</span>
<RangePicker <RangePicker
......
...@@ -51,6 +51,7 @@ class addEdit extends React.Component { ...@@ -51,6 +51,7 @@ class addEdit extends React.Component {
return; return;
} }
const { param } = this.props; const { param } = this.props;
console.log(param, 1111111);
if (param !== null) { if (param !== null) {
this.setState({ this.setState({
uploadParams: { uploadParams: {
...@@ -168,16 +169,40 @@ class addEdit extends React.Component { ...@@ -168,16 +169,40 @@ class addEdit extends React.Component {
const { getFieldDecorator } = form; const { getFieldDecorator } = form;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 24 }, span: 2,
sm: { span: 4 },
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, span: 22,
sm: { span: 20 },
}, },
}; };
const { id } = this.props.seeEdit; const { id } = this.props.seeEdit;
console.log(JSON.parse(seeEdit.ossUrl));
let residences;
if (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,
children: items.childClassifyNews.map((itemss, indexss) => {
return {
value: itemss.id,
label: itemss.name,
children: [],
};
}),
};
}),
};
} else {
return { value: item.id, label: item.name };
}
});
}
return ( return (
<Modal <Modal
visible={visible} visible={visible}
...@@ -235,7 +260,14 @@ class addEdit extends React.Component { ...@@ -235,7 +260,14 @@ class addEdit extends React.Component {
/> />
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="上传文件"> <FormItem {...formItemLayout} label="图片">
{seeEdit.ossUrl &&
JSON.parse(seeEdit.ossUrl).length > 0 &&
JSON.parse(seeEdit.ossUrl).map((item, index) => (
<img key={index} src={item} alt="" style={{ width: "300px" }} />
))}
</FormItem>
{/* <FormItem {...formItemLayout} label="上传文件">
<Upload <Upload
headers={{ "X-Requested-With": null }} headers={{ "X-Requested-With": null }}
fileList={this.state.fileList} fileList={this.state.fileList}
...@@ -250,12 +282,38 @@ class addEdit extends React.Component { ...@@ -250,12 +282,38 @@ class addEdit extends React.Component {
</Button> </Button>
</Upload> </Upload>
<p>大小50mb以内</p> <p>大小50mb以内</p>
</FormItem> </FormItem> */}
<FormItem {...formItemLayout} label="作者"> <FormItem {...formItemLayout} label="作者">
{getFieldDecorator("author", { {getFieldDecorator("author", {
initialValue: seeEdit && seeEdit.author, initialValue: seeEdit && seeEdit.author,
})(<Input disabled={type != "edit" ? true : false} />)} })(<Input disabled={type != "edit" ? true : false} />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="所属栏位">
{getFieldDecorator("type", {
initialValue: seeEdit && [
seeEdit.typeOne,
seeEdit.typeTwo,
seeEdit.typeThree,
],
rules: [
{
type: "array",
required: true,
message: "请输入所属栏位!",
},
],
})(
<Cascader
multiple
disabled={type != "edit" ? true : false}
options={residences}
onChange={this.loadData}
// disabled={type == "look" ? !false : false}
changeOnSelect={true}
placeholder="请选择"
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="支部或部室"> <FormItem {...formItemLayout} label="支部或部室">
{getFieldDecorator("deptName", { {getFieldDecorator("deptName", {
initialValue: seeEdit && seeEdit.deptName, initialValue: seeEdit && seeEdit.deptName,
......
...@@ -77,14 +77,14 @@ class Header extends React.Component { ...@@ -77,14 +77,14 @@ class Header extends React.Component {
</FormItem> </FormItem>
<FormItem label="投稿状态:"> <FormItem label="投稿状态:">
{getFieldDecorator("state")( {getFieldDecorator("state")(
<Select style={{ width: "200px" }} placeholder="请选择投稿状态"> <Select style={{ width: "185px" }} placeholder="请选择投稿状态">
{option} {option}
</Select> </Select>
)} )}
</FormItem> </FormItem>
<FormItem label="审核时间"> <FormItem label="审核时间">
{getFieldDecorator("time")( {getFieldDecorator("time")(
<RangePicker style={{ width: "220px" }} format="YYYY-MM-DD" /> <RangePicker style={{ width: "200px" }} format="YYYY-MM-DD" />
)} )}
</FormItem> </FormItem>
</Col> </Col>
......
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
getList, getList,
menu, menu,
} from "./redux/action"; } from "./redux/action";
import { getIficationList } from "../Information/redux/action";
import moment from "moment"; import moment from "moment";
import Styles from "./style.less"; import Styles from "./style.less";
const TreeNode = Tree.TreeNode; const TreeNode = Tree.TreeNode;
...@@ -59,6 +60,7 @@ class Atricle extends React.Component { ...@@ -59,6 +60,7 @@ class Atricle extends React.Component {
} }
componentDidMount() { componentDidMount() {
const { page, pagesize } = this.state; const { page, pagesize } = this.state;
this.props.getIficationList({}, () => {});
let _this = this; let _this = this;
this.props.getList( this.props.getList(
{ {
...@@ -244,7 +246,7 @@ class Atricle extends React.Component { ...@@ -244,7 +246,7 @@ class Atricle extends React.Component {
if (type == 1) { if (type == 1) {
//发布 //发布
postReleases({ ids: [id] }, () => { postReleases({ id }, () => {
getList( getList(
_this.filterParams({ _this.filterParams({
pageNo: page, pageNo: page,
...@@ -262,7 +264,7 @@ class Atricle extends React.Component { ...@@ -262,7 +264,7 @@ class Atricle extends React.Component {
}); });
} else { } else {
//取消发布 //取消发布
postUnReleases({ ids: [id] }, () => { postUnReleases({ id }, () => {
getList( getList(
_this.filterParams({ _this.filterParams({
pageNo: page, pageNo: page,
...@@ -298,6 +300,9 @@ class Atricle extends React.Component { ...@@ -298,6 +300,9 @@ class Atricle extends React.Component {
deptName: values.deptName, deptName: values.deptName,
pdfOssUrl: pdfOssUrl, pdfOssUrl: pdfOssUrl,
pdfFileName: pdfFileName, pdfFileName: pdfFileName,
typeOne: values.type[0],
typeTwo: values.type[1] ? values.type[1] : 0,
typeThree: values.type[2] ? values.type[2] : 0,
}; };
postUpdata(_this.filterParams(jsonEdit), () => { postUpdata(_this.filterParams(jsonEdit), () => {
// reset // reset
...@@ -329,6 +334,7 @@ class Atricle extends React.Component { ...@@ -329,6 +334,7 @@ class Atricle extends React.Component {
{ {
title: "序号", title: "序号",
dataIndex: "key", dataIndex: "key",
width: "80px",
key: "key", key: "key",
render: (text, record, index) => ( render: (text, record, index) => (
<span>{this.state.pagesize * (this.state.page - 1) + index + 1}</span> <span>{this.state.pagesize * (this.state.page - 1) + index + 1}</span>
...@@ -337,6 +343,7 @@ class Atricle extends React.Component { ...@@ -337,6 +343,7 @@ class Atricle extends React.Component {
{ {
title: "投稿id", title: "投稿id",
dataIndex: "number", dataIndex: "number",
width: "100px",
key: "number", key: "number",
render: text => { render: text => {
return <span title={text}>{text}</span>; return <span title={text}>{text}</span>;
...@@ -345,6 +352,7 @@ class Atricle extends React.Component { ...@@ -345,6 +352,7 @@ class Atricle extends React.Component {
{ {
title: "投稿类型", title: "投稿类型",
dataIndex: "typeId", dataIndex: "typeId",
width: "100px",
key: "typeId", key: "typeId",
render: (text, record) => { render: (text, record) => {
return ( return (
...@@ -357,6 +365,7 @@ class Atricle extends React.Component { ...@@ -357,6 +365,7 @@ class Atricle extends React.Component {
{ {
title: "作者", title: "作者",
dataIndex: "author", dataIndex: "author",
width: "100px",
key: "author", key: "author",
render: text => { render: text => {
return <span title={text}>{text}</span>; return <span title={text}>{text}</span>;
...@@ -365,6 +374,7 @@ class Atricle extends React.Component { ...@@ -365,6 +374,7 @@ class Atricle extends React.Component {
{ {
title: "支部或部室", title: "支部或部室",
dataIndex: "deptName", dataIndex: "deptName",
width: "150px",
key: "deptName", key: "deptName",
render: text => { render: text => {
return <span title={text}>{text}</span>; return <span title={text}>{text}</span>;
...@@ -373,12 +383,16 @@ class Atricle extends React.Component { ...@@ -373,12 +383,16 @@ class Atricle extends React.Component {
{ {
title: "投稿时间", title: "投稿时间",
dataIndex: "submitTime", dataIndex: "submitTime",
width: "100px",
key: "submitTime", key: "submitTime",
render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>, render: text => (
<span>{text ? moment(text).format("YYYY-MM-DD HH:mm") : "-"}</span>
),
}, },
{ {
title: "投稿标题", title: "投稿标题",
dataIndex: "fileName", dataIndex: "fileName",
width: "200px",
key: "fileName", key: "fileName",
render: text => { render: text => {
return ( return (
...@@ -390,13 +404,17 @@ class Atricle extends React.Component { ...@@ -390,13 +404,17 @@ class Atricle extends React.Component {
}, },
{ {
title: "审核时间", title: "审核时间",
width: "100px",
dataIndex: "approveTime", dataIndex: "approveTime",
key: "approveTime", key: "approveTime",
render: text => <span>{moment(text).format("YYYY-MM-DD HH:mm")}</span>, render: text => (
<span>{text ? moment(text).format("YYYY-MM-DD HH:mm") : "-"}</span>
),
}, },
{ {
title: "状态", title: "状态",
dataIndex: "state", dataIndex: "state",
width: "80px",
key: "state", key: "state",
render: text => <span>{this.getStatus(text)}</span>, render: text => <span>{this.getStatus(text)}</span>,
}, },
...@@ -404,7 +422,7 @@ class Atricle extends React.Component { ...@@ -404,7 +422,7 @@ class Atricle extends React.Component {
title: "操作", title: "操作",
dataIndex: "operation", dataIndex: "operation",
key: "operation", key: "operation",
width: "30%", width: "300px",
render: (text, record) => { render: (text, record) => {
return ( return (
<div> <div>
...@@ -530,6 +548,7 @@ function mapStateToProps(state, ownProps) { ...@@ -530,6 +548,7 @@ function mapStateToProps(state, ownProps) {
return { return {
tableList: state.article.tableList, tableList: state.article.tableList,
menuList: state.article.menuList, menuList: state.article.menuList,
ificationList: state.information.ificationList,
}; };
} }
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
...@@ -545,6 +564,8 @@ function mapDispatchToProps(dispatch) { ...@@ -545,6 +564,8 @@ function mapDispatchToProps(dispatch) {
getSeeEdit: (obj, callback) => dispatch(getSeeEdit(obj, callback)), getSeeEdit: (obj, callback) => dispatch(getSeeEdit(obj, callback)),
getApprove: (obj, callback) => dispatch(getApprove(obj, callback)), getApprove: (obj, callback) => dispatch(getApprove(obj, callback)),
menu: (obj, callback) => dispatch(menu(obj, callback)), menu: (obj, callback) => dispatch(menu(obj, callback)),
getIficationList: (obj, callback) =>
dispatch(getIficationList(obj, callback)),
}; };
} }
export default connect(mapStateToProps, mapDispatchToProps)(Atricle); export default connect(mapStateToProps, mapDispatchToProps)(Atricle);
import services from "@/services/serve"; import services from "@/services/serve";
export default { export default {
postReleasesApi: `POST ${services.webManage}/site/classify/publication/releases`, //id postReleasesApi: `GET ${services.webManage}/site/classify/publication/releases`, //id
postUnReleasesApi: `POST ${services.webManage}/site/classify/publication/unreleases`, //id postUnReleasesApi: `GET ${services.webManage}/site/classify/publication/unreleases`, //id
postInsertApi: `POST ${services.webManage}/site/classify/publication/insert`, postInsertApi: `POST ${services.webManage}/site/classify/publication/insert`,
getSeeEditApi: `GET ${services.webManage}/site/classify/publication/view`, //id getSeeEditApi: `GET ${services.webManage}/site/classify/publication/view`, //id
postUpdataApi: `POST ${services.webManage}/site/classify/publication/update`, postUpdataApi: `POST ${services.webManage}/site/classify/publication/update`,
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
* */ * */
import React from "react"; import React from "react";
import { Table, Select, Popconfirm, Button } from "antd"; import { Table, Select, Popconfirm, Button, Form, Row, Col, Input } from "antd";
const FormItem = Form.Item;
import { connect } from "react-redux"; import { connect } from "react-redux";
import styles from "./index.less"; import styles from "./index.less";
import intl from "react-intl-universal"; import intl from "react-intl-universal";
...@@ -169,23 +170,42 @@ class Banner extends React.PureComponent { ...@@ -169,23 +170,42 @@ class Banner extends React.PureComponent {
componentDidMount() { componentDidMount() {
this.reGetBannerList(); this.reGetBannerList();
} }
filterParams(params) {
reGetBannerList = () => { for (let key in params) {
if (
params[key] === "" ||
params[key] === null ||
params[key] === undefined
) {
delete params[key];
}
}
return params;
}
reGetBannerList = values => {
let { let {
currentTerminal = {}, currentTerminal = {},
currentModule = {}, currentModule = {},
state,
pageNo, pageNo,
pageSize, pageSize,
} = this.state; } = this.state;
let _this = this; let _this = this;
let param = { let param;
bannerName: currentModule.moduleName, values
terminalName: currentTerminal.terminalName, // 移动端 或 PC ? (param = {
state: state, bannerName: currentModule.moduleName,
pageNo: pageNo, terminalName: currentTerminal.terminalName, // 移动端 或 PC
pageSize: pageSize, pageNo: pageNo,
}; pageSize: pageSize,
...values,
})
: (param = {
bannerName: currentModule.moduleName,
terminalName: currentTerminal.terminalName, // 移动端 或 PC
pageNo: pageNo,
pageSize: pageSize,
state: 3,
});
this.props.getBannerList(param, () => { this.props.getBannerList(param, () => {
let { bannerList = {} } = _this.props; let { bannerList = {} } = _this.props;
let { page = {} } = bannerList; let { page = {} } = bannerList;
...@@ -264,10 +284,19 @@ class Banner extends React.PureComponent { ...@@ -264,10 +284,19 @@ class Banner extends React.PureComponent {
editBannerVS: false, editBannerVS: false,
}); });
}; };
handleSubmit = e => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
this.reGetBannerList(values);
}
});
};
render() { render() {
console.log("this.props==", this.props); console.log("this.props==", this.props);
console.log("this.state==", this.state); console.log("this.state==", this.state);
const { getFieldDecorator, resetFields } = this.props.form;
const { const {
currentModule = {}, currentModule = {},
currentTerminal = {}, currentTerminal = {},
...@@ -277,7 +306,7 @@ class Banner extends React.PureComponent { ...@@ -277,7 +306,7 @@ class Banner extends React.PureComponent {
return ( return (
<div className={styles.banner_manage_body}> <div className={styles.banner_manage_body}>
<Breadcrumb title="滚动首图管理" /> <Breadcrumb title="滚动首图管理" />
<div className={styles.left}> {/* <div className={styles.left}>
{this.terminalList.map((item, index) => { {this.terminalList.map((item, index) => {
return ( return (
<div key={item.id} className={styles.terminalItem}> <div key={item.id} className={styles.terminalItem}>
...@@ -304,29 +333,66 @@ class Banner extends React.PureComponent { ...@@ -304,29 +333,66 @@ class Banner extends React.PureComponent {
</div> </div>
); );
})} })}
</div> </div> */}
<Row>
<Form
layout="inline"
onSubmit={this.handleSubmit}
style={{ paddingBottom: 30 }}
>
<Col span={22} offset={1}>
<FormItem label="图片名称:">
{getFieldDecorator("imgTitle")(
<Input
style={{ width: "200px" }}
placeholder="请输入图片名称"
/>
)}
</FormItem>
<FormItem label="状态:">
{getFieldDecorator("state", { initialValue: "3" })(
<Select
style={{ width: "200px" }}
placeholder="请选择问题类型"
>
<Option value="3">全部</Option>
<Option value="1">已上架</Option>
<Option value="2">已下架</Option>
</Select>
)}
</FormItem>
</Col>
<Col span={8} offset={16}>
<FormItem>
<Button
type="primary"
onClick={() => this.toEditBanner({}, "add")}
style={{ marginRight: 8 }}
>
新建Banner
</Button>
<Button
type="primary"
onClick={() => {
resetFields();
this.reGetBannerList();
}}
style={{ marginRight: 8 }}
>
重置
</Button>
<Button
type="primary"
htmlType="submit"
style={{ marginLeft: "30px" }}
>
查询
</Button>
</FormItem>
</Col>
</Form>
</Row>
<div className={styles.right}> <div className={styles.right}>
<div className={styles.rightTop}>
<div className={styles.topLeft}>Bannner列表</div>
<div className={styles.topRight}>
<Button
type="primary"
onClick={() => this.toEditBanner({}, "add")}
style={{ marginRight: 8 }}
>
新建Banner
</Button>
<Select
style={{ width: 152 }}
value={this.state.state}
onChange={this.selectState}
>
<Option value="3">全部</Option>
<Option value="1">已上架</Option>
<Option value="2">已下架</Option>
</Select>
</div>
</div>
<Table <Table
rowKey={record => record.id} rowKey={record => record.id}
columns={this.columns} columns={this.columns}
...@@ -381,4 +447,7 @@ function mapDispatchToProps(dispatch) { ...@@ -381,4 +447,7 @@ function mapDispatchToProps(dispatch) {
dispatch(handleBannerDelete(param, callback)), dispatch(handleBannerDelete(param, callback)),
}; };
} }
export default connect(mapStateToProps, mapDispatchToProps)(Banner); export default connect(
mapStateToProps,
mapDispatchToProps
)(Form.create()(Banner));
.banner_manage_body { .banner_manage_body {
display: flex;
// padding: 16px; // padding: 16px;
border-radius: 4px; border-radius: 4px;
......
import React from "react"; import React from "react";
import { Form, Icon, Input, Button, DatePicker } from "antd"; import { Row, Col, Form, Icon, Input, Button, DatePicker, Select } from "antd";
const FormItem = Form.Item; const FormItem = Form.Item;
const Option = Select.Option;
const RangePicker = DatePicker.RangePicker; const RangePicker = DatePicker.RangePicker;
class Header extends React.Component { class Header extends React.Component {
handleSubmit = e => { handleSubmit = e => {
...@@ -11,53 +12,105 @@ class Header extends React.Component { ...@@ -11,53 +12,105 @@ class Header extends React.Component {
} }
}); });
}; };
reset = () => {
this.props.headForm({});
};
showModal = () => { showModal = () => {
this.props.showModal(); this.props.showModal();
}; };
render() { render() {
const { const {
getFieldDecorator, getFieldDecorator,
resetFields,
getFieldsError, getFieldsError,
getFieldError, getFieldError,
isFieldTouched, isFieldTouched,
} = this.props.form; } = this.props.form;
const List = [
{ value: 2, text: "上架" },
{ value: 1, text: "下架" },
];
const option = List.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
const List1 = [
{ value: 1, text: "同步首页" },
{ value: 2, text: "移除首页" },
];
const option1 = List1.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
return ( return (
<Form <Row>
layout="inline" <Form
onSubmit={this.handleSubmit} layout="inline"
style={{ paddingBottom: 30 }} onSubmit={this.handleSubmit}
> style={{ paddingBottom: 30 }}
<FormItem label="关键字(词):"> >
{getFieldDecorator("fileName")( <Col span={22} offset={1}>
<Input <FormItem label="关键字(词):">
style={{ width: "250px" }} {getFieldDecorator("fileName")(
placeholder="请输入资讯标题、自定义关键词" <Input
/> style={{ width: "200px" }}
)} placeholder="请输入资讯标题、自定义关键词"
</FormItem> />
{/* <FormItem label="关键字"> )}
{getFieldDecorator('keyWords')( </FormItem>
<Input placeholder="请输入资讯标题" /> <FormItem label="发布状态:">
)} {getFieldDecorator("state")(
</FormItem> */} <Select style={{ width: "200px" }} placeholder="请选择发布状态">
<FormItem label="创建时间"> {option}
{getFieldDecorator("time")( </Select>
<RangePicker style={{ width: "220px" }} format="YYYY-MM-DD" /> )}
)} </FormItem>
</FormItem> <FormItem label="是否同步首页:">
<FormItem> {getFieldDecorator("isTop")(
<Button type="primary" htmlType="submit"> <Select
查询 style={{ width: "200px" }}
</Button> placeholder="请选择是否同步首页"
<Button >
type="primary" {option1}
style={{ marginLeft: "30px" }} </Select>
onClick={this.showModal} )}
> </FormItem>
新建内容 <FormItem label="修改时间">
</Button> {getFieldDecorator("time")(<RangePicker format="YYYY-MM-DD" />)}
</FormItem> </FormItem>
</Form> </Col>
<Col span={8} offset={16}>
<FormItem>
<Button type="primary" htmlType="submit">
查询
</Button>
<Button
style={{ marginLeft: "30px" }}
type="primary"
onClick={() => {
resetFields();
this.reset();
}}
>
重置
</Button>
<Button
type="primary"
style={{ marginLeft: "30px" }}
onClick={this.showModal}
>
新建内容
</Button>
</FormItem>
</Col>
</Form>
</Row>
); );
} }
} }
......
...@@ -15,6 +15,7 @@ const { ...@@ -15,6 +15,7 @@ const {
postInsertApi, postInsertApi,
getSeeEditApi, getSeeEditApi,
postUpdataApi, postUpdataApi,
getMenuApi,
} = apis; } = apis;
//资讯管理 //资讯管理
...@@ -28,6 +29,7 @@ export const SEEEDIT = "SEEEDIT"; ...@@ -28,6 +29,7 @@ export const SEEEDIT = "SEEEDIT";
// let seeEdit = createAction(SEEEDIT); // let seeEdit = createAction(SEEEDIT);
export const NULLSEEEDIT = "NULLSEEEDIT"; export const NULLSEEEDIT = "NULLSEEEDIT";
// let nullSeeEdit = createAction(NULLSEEEDIT); // let nullSeeEdit = createAction(NULLSEEEDIT);
export const MENULIST = "MENULIST";
// 获取分类信息 // 获取分类信息
export function getIficationList(data, callback) { export function getIficationList(data, callback) {
return dispatch => { return dispatch => {
...@@ -223,3 +225,17 @@ export function nullSeeEdit(data, callback) { ...@@ -223,3 +225,17 @@ export function nullSeeEdit(data, callback) {
return dispatch({ type: NULLSEEEDIT }); return dispatch({ type: NULLSEEEDIT });
}; };
} }
export function getMenu(data, callback) {
return dispatch => {
// return fetch(api.informationUrl+`/manage/site/classify/info/insert`,{type:'POST',data:data})
return request({
url: getMenuApi,
data: data,
}).then(res => {
dispatch({ type: MENULIST, data: res.data });
if (callback) {
callback();
}
});
};
}
...@@ -12,4 +12,5 @@ export default { ...@@ -12,4 +12,5 @@ export default {
postInsertApi: `POST ${services.webManage}/site/classify/info/insert`, postInsertApi: `POST ${services.webManage}/site/classify/info/insert`,
getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`, getSeeEditApi: `GET ${services.webManage}/site/classify/info/view`,
postUpdataApi: `POST ${services.webManage}/site/classify/info/update`, postUpdataApi: `POST ${services.webManage}/site/classify/info/update`,
getMenuApi: `GET ${services.base}/system/dictionary/child/listByCode`,
}; };
...@@ -11,6 +11,7 @@ const initialState = { ...@@ -11,6 +11,7 @@ const initialState = {
tableList: null, tableList: null,
classifySelect: null, classifySelect: null,
seeEdit: null, seeEdit: null,
menuList: [],
}; };
function information(state = initialState, action) { function information(state = initialState, action) {
...@@ -40,6 +41,10 @@ function information(state = initialState, action) { ...@@ -40,6 +41,10 @@ function information(state = initialState, action) {
return Object.assign({}, state, { return Object.assign({}, state, {
seeEdit: null, seeEdit: null,
}); });
case "MENULIST":
return Object.assign({}, state, {
menuList: action.data,
});
default: default:
return state; return state;
} }
......
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;
const types = this.props.seeEdit.type;
return (
<Modal
visible={visible}
title={title}
okText="确定"
width={1000}
destroyOnClose
onCancel={onCancel}
footer={
<>
{type == "edit" && (
<Button
key="1"
type="primary"
onClick={() => onCreate(id, types)}
>
保存
</Button>
)}
<Button key="3" type="primary" onClick={onCancel}>
返回
</Button>
</>
}
>
<Form>
<FormItem {...formItemLayout} label="联系人">
{getFieldDecorator("contactName", {
initialValue: seeEdit && seeEdit.contactName,
})(<Input style={{ width: "300px" }} disabled />)}
</FormItem>
<FormItem {...formItemLayout} label="联系人手机/邮箱">
{getFieldDecorator("contactNumber", {
initialValue: seeEdit && seeEdit.contactNumber,
})(<Input style={{ width: "300px" }} disabled />)}
</FormItem>
<FormItem {...formItemLayout} label="来源类型">
{getFieldDecorator("targetFrom", {
initialValue: seeEdit && seeEdit.targetFrom,
})(
<Input
style={{ width: "300px" }}
disabled={type != "edit" ? true : false}
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="标题">
{getFieldDecorator("name", {
initialValue: seeEdit && seeEdit.fileName,
})(
<Input
style={{ width: "300px" }}
disabled={type != "edit" ? true : false}
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="图片">
{seeEdit.ossPicUrl &&
JSON.parse(seeEdit.ossPicUrl).length > 0 &&
JSON.parse(seeEdit.ossPicUrl).map((item, index) => (
<img key={index} src={item} alt="" style={{ width: "300px" }} />
))}
</FormItem>
<FormItem {...formItemLayout} label="视频">
{seeEdit.ossVideoUrl &&
JSON.parse(seeEdit.ossVideoUrl).length > 0 &&
JSON.parse(seeEdit.ossVideoUrl).map((item, index) => (
<video
style={{ width: "300px" }}
key={index}
src={item}
controls="controls"
>
您的浏览器不支持 video 标签。
</video>
))}
</FormItem>
<FormItem {...formItemLayout} label="内容">
{getFieldDecorator("content", {
initialValue: seeEdit && seeEdit.content,
})(
<textarea
style={{ width: "600px", minHeight: "200px" }}
disabled={type != "edit" ? true : false}
/>
)}
</FormItem>
{types == 2 && (
<FormItem {...formItemLayout} label="期望结果">
{getFieldDecorator("remark", {
initialValue: seeEdit && seeEdit.remark,
})(
<textarea
style={{ width: "600px", minHeight: "200px" }}
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: 1, text: "纪检" },
{ value: 2, text: "书记" },
];
const option = List.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
const status = [
{ value: 1, text: "代接收" },
{ value: 2, text: "已接收" },
];
const types = status.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
return (
<Row>
<Form
layout="inline"
onSubmit={this.handleSubmit}
style={{ paddingBottom: 30 }}
>
<Col span={22} offset={1}>
<FormItem label="信箱标题:">
{getFieldDecorator("fileName")(
<Input
style={{ width: "200px" }}
placeholder="请输入信箱标题"
/>
)}
</FormItem>
<FormItem label="信箱类型:">
{getFieldDecorator("type")(
<Select style={{ width: "200px" }} placeholder="请选择信箱类型">
{option}
</Select>
)}
</FormItem>
<FormItem label="联系人:">
{getFieldDecorator("contactName")(
<Input style={{ width: "200px" }} placeholder="请输入联系人" />
)}
</FormItem>
</Col>
<Col span={6} offset={18}>
<FormItem>
<Button
type="primary"
onClick={() => {
resetFields();
this.reset();
}}
>
重置
</Button>
<Button
type="primary"
htmlType="submit"
style={{ marginLeft: "30px" }}
>
查询
</Button>
</FormItem>
</Col>
</Form>
</Row>
);
}
}
const Head = Form.create()(Header);
export default Head;
import { message } from "antd";
import request from "@/util/request.js";
import apis from "./api";
const {
// postReleasesApi,
// postUnReleasesApi,
// postInsertApi,
// postUpdataApi,
// getApproveApi,
// getUnapproveApi,
getSeeEditApi,
// searchApi,
updateState,
updateState1,
listApi,
deleteApi,
// 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 getUpdateState(data, callback) {
return dispatch => {
return request({
url: updateState,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
// 更新状态
export function getUpdateState1(data, callback) {
return dispatch => {
return request({
url: updateState1,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
// 删除
export function getDelete(data, callback) {
return dispatch => {
return request({
url: deleteApi,
data: data,
}).then(res => {
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}/systemMailbox/getById`, //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
updateState: `POST ${services.webManage}/systemMailbox/save/1`,
updateState1: `POST ${services.webManage}/systemMailbox/save/2`,
listApi: `POST ${services.webManage}/systemMailbox/selectPage`,
deleteApi: `GET ${services.webManage}/systemMailbox/removeById`,
// 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
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, state } = this.props.seeEdit;
return (
<Modal
visible={visible}
title={title}
okText="确定"
width={1000}
destroyOnClose
onCancel={onCancel}
footer={
<>
{state == 1 && (
<Button key="1" type="primary" onClick={() => onApprove(id, 2)}>
接收
</Button>
)}
<Button key="3" type="primary" onClick={onCancel}>
返回
</Button>
</>
}
>
<Form>
<FormItem {...formItemLayout} label="留言标题">
{getFieldDecorator("name", {
initialValue: seeEdit && seeEdit.name,
})(
<Input
disabled={type != "edit" ? true : false}
style={{ width: "300px" }}
/>
)}
</FormItem>
<FormItem {...formItemLayout} label="留言图片">
{seeEdit.ossUrl &&
JSON.parse(seeEdit.ossUrl).length > 0 &&
JSON.parse(seeEdit.ossUrl).map((item, index) => (
<img key={index} src={item} alt="" style={{ width: "300px" }} />
))}
</FormItem>
<FormItem {...formItemLayout} label="内容">
{getFieldDecorator("content", {
initialValue: seeEdit && seeEdit.content,
})(
<textarea
disabled={type != "edit" ? true : false}
style={{ width: "600px", minHeight: "200px" }}
/>
)}
</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: 1, text: "功能异常" },
{ value: 2, text: "体验问题" },
{ value: 3, text: "产品建议" },
{ value: 4, text: "其他" },
];
const option = List.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
const status = [
{ value: 1, text: "代接收" },
{ value: 2, text: "已接收" },
];
const types = status.map((item, index) => {
return (
<Option value={item.value} key={index}>
{item.text}
</Option>
);
});
return (
<Row>
<Form
layout="inline"
onSubmit={this.handleSubmit}
style={{ paddingBottom: 30 }}
>
<Col span={22} offset={1}>
<FormItem label="留言类型:">
{getFieldDecorator("bizType")(
<Select style={{ width: "200px" }} placeholder="请选择留言类型">
{option}
</Select>
)}
</FormItem>
<FormItem label="用户名:">
{getFieldDecorator("createByName")(
<Input style={{ width: "200px" }} placeholder="请输入用户名" />
)}
</FormItem>
<FormItem label="状态:">
{getFieldDecorator("state")(
<Select style={{ width: "200px" }} placeholder="请选择问题类型">
{types}
</Select>
)}
</FormItem>
</Col>
<Col span={6} offset={18}>
<FormItem>
<Button
type="primary"
onClick={() => {
resetFields();
this.reset();
}}
>
重置
</Button>
<Button
type="primary"
htmlType="submit"
style={{ marginLeft: "30px" }}
>
查询
</Button>
</FormItem>
</Col>
</Form>
</Row>
);
}
}
const Head = Form.create()(Header);
export default Head;
import { message } from "antd";
import request from "@/util/request.js";
import apis from "./api";
const {
// postReleasesApi,
// postUnReleasesApi,
// postInsertApi,
// postUpdataApi,
// getApproveApi,
// getUnapproveApi,
getSeeEditApi,
// searchApi,
updateState,
listApi,
deleteApi,
// 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 getUpdateState(data, callback) {
return dispatch => {
return request({
url: updateState,
data: data,
}).then(res => {
if (callback) {
callback();
}
});
};
}
// 删除
export function getDelete(data, callback) {
return dispatch => {
return request({
url: deleteApi,
data: data,
}).then(res => {
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}/leaveWord/getById`, //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
updateState: `GET ${services.webManage}/leaveWord/updateState`,
listApi: `POST ${services.webManage}/leaveWord/page`,
deleteApi: `GET ${services.webManage}/leaveWord/removeById`,
// 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
...@@ -80,7 +80,7 @@ class AddUser extends Component { ...@@ -80,7 +80,7 @@ class AddUser extends Component {
// console.log(userJson); // console.log(userJson);
//添加用户action //关闭模态框onCancel //添加用户action //关闭模态框onCancel
this.props.insertUser(userJson, res => { this.props.insertUser(userJson, res => {
message.success("新增用户成功") message.success("新增用户成功");
this.props.onCancel(false); this.props.onCancel(false);
this.props.handleSearch(); //bug-12527-liyuan this.props.handleSearch(); //bug-12527-liyuan
}); });
...@@ -153,8 +153,9 @@ class AddUser extends Component { ...@@ -153,8 +153,9 @@ class AddUser extends Component {
rules: [ rules: [
{ {
required: true, required: true,
pattern: /^\w+$/, pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~@#$%\*-\+=:,\\?\[\]\{}]).{8,16}$/,
message: "只能输入大小英文字母和数字", message:
"8-16位字符,同时包括数字、大小写字母和特殊字符四种组合",
}, },
], ],
})(<Input placeholder="密码" type="password" />)} })(<Input placeholder="密码" type="password" />)}
......
...@@ -30,10 +30,9 @@ class AddUser extends Component { ...@@ -30,10 +30,9 @@ class AddUser extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
companyCode:"", companyCode: "",
siteCode:"" siteCode: "",
}; };
} }
onChange = (orgId, val, extra) => { onChange = (orgId, val, extra) => {
// orgId = orgId?orgId.replace(val,""):""; // orgId = orgId?orgId.replace(val,""):"";
...@@ -47,9 +46,9 @@ class AddUser extends Component { ...@@ -47,9 +46,9 @@ class AddUser extends Component {
handleSubmit = e => { handleSubmit = e => {
e.preventDefault(); e.preventDefault();
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (err){ if (err) {
return; return;
} }
//选择设置时间 //选择设置时间
let { time } = values; let { time } = values;
let startTime; let startTime;
...@@ -88,23 +87,21 @@ class AddUser extends Component { ...@@ -88,23 +87,21 @@ class AddUser extends Component {
let userJson = { ...userValue, orgId }; let userJson = { ...userValue, orgId };
console.log("用户信息说明=================" + userJson); console.log("用户信息说明=================" + userJson);
//添加用户action //关闭模态框onCancel //添加用户action //关闭模态框onCancel
const _this = this const _this = this;
this.props.insertUser(userJson, res => { this.props.insertUser(userJson, res => {
message.success("新增用户成功") message.success("新增用户成功");
_this.props.history.push( _this.props.history.push({
{ pathname:
pathname: "/" +
"/" + this.state.companyCode +
this.state.companyCode + "/" +
"/" + this.state.siteCode +
this.state.siteCode + "/index/manager/system/organization",
"/index/manager/system/organization", state: {
state:{ flag: true,
flag:true },
} });
}
);
// _this.props.handleSearch(); //bug-12527-liyuan // _this.props.handleSearch(); //bug-12527-liyuan
}); });
// this.props.handleSearch(); bug-12527-liyuan // this.props.handleSearch(); bug-12527-liyuan
...@@ -112,24 +109,22 @@ class AddUser extends Component { ...@@ -112,24 +109,22 @@ class AddUser extends Component {
}); });
}; };
handleCancelAddUser = () =>{ handleCancelAddUser = () => {
this.props.history.push( this.props.history.push({
{ pathname:
pathname: "/" +
"/" + this.state.companyCode +
this.state.companyCode + "/" +
"/" + this.state.siteCode +
this.state.siteCode + "/index/manager/system/organization",
"/index/manager/system/organization", state: {
state:{ flag: true,
flag:true },
} });
} };
);
}
render() { render() {
let treeData = this.props.location.state.departmentTree.trees let treeData = this.props.location.state.departmentTree.trees;
this.state.companyCode = this.props.location.state.companyCode; this.state.companyCode = this.props.location.state.companyCode;
this.state.siteCode = this.props.location.state.siteCode; this.state.siteCode = this.props.location.state.siteCode;
// = this.props.location.state.companyCode // = this.props.location.state.companyCode
...@@ -192,18 +187,31 @@ class AddUser extends Component { ...@@ -192,18 +187,31 @@ class AddUser extends Component {
}, },
}, },
], ],
})(<Input placeholder="请输入有效用户名称" maxLength={51} autocomplete="off"/>)} })(
<Input
placeholder="请输入有效用户名称"
maxLength={51}
autocomplete="off"
/>
)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="密码:"> <FormItem {...formItemLayout} label="密码:">
{getFieldDecorator("userPassword", { {getFieldDecorator("userPassword", {
rules: [ rules: [
{ {
required: true, required: true,
pattern: /^\w+$/, pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~@#$%\*-\+=:,\\?\[\]\{}]).{8,16}$/,
message: "只能输入大小英文字母和数字", message:
"8-16位字符,同时包括数字、大小写字母和特殊字符四种组合",
}, },
], ],
})(<Input placeholder="密码" type="password" autoComplete="new-password" />)} })(
<Input
placeholder="密码"
type="password"
autoComplete="new-password"
/>
)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="工号:"> <FormItem {...formItemLayout} label="工号:">
{getFieldDecorator("workNum", { {getFieldDecorator("workNum", {
...@@ -211,12 +219,17 @@ class AddUser extends Component { ...@@ -211,12 +219,17 @@ class AddUser extends Component {
})(<Input placeholder="请输入工号" />)} })(<Input placeholder="请输入工号" />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="姓名:"> <FormItem {...formItemLayout} label="姓名:">
{getFieldDecorator("fullName", {})(<Input placeholder="请输入姓名" />)} {getFieldDecorator(
"fullName",
{}
)(<Input placeholder="请输入姓名" />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="部门"> <FormItem {...formItemLayout} label="部门">
{getFieldDecorator("orgId", { {getFieldDecorator("orgId", {
// initialValue:window.orgId // initialValue:window.orgId
initialValue: window._orgName ? window._orgName : treeData[0].name, initialValue: window._orgName
? window._orgName
: treeData[0].name,
})( })(
<TreeSelect <TreeSelect
showSearch showSearch
...@@ -231,7 +244,10 @@ class AddUser extends Component { ...@@ -231,7 +244,10 @@ class AddUser extends Component {
)} )}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="职务:"> <FormItem {...formItemLayout} label="职务:">
{getFieldDecorator("position", {})(<Input placeholder="请输入职务" />)} {getFieldDecorator(
"position",
{}
)(<Input placeholder="请输入职务" />)}
</FormItem> </FormItem>
<FormItem {...formItemLayout} label="手机号:"> <FormItem {...formItemLayout} label="手机号:">
{getFieldDecorator("mobile", { {getFieldDecorator("mobile", {
...@@ -323,17 +339,20 @@ class AddUser extends Component { ...@@ -323,17 +339,20 @@ class AddUser extends Component {
rules: [{ required: true, message: "请选择有效期" }], rules: [{ required: true, message: "请选择有效期" }],
})( })(
<RadioGroup> <RadioGroup>
<div style={{marginTop:"10px"}}> <div style={{ marginTop: "10px" }}>
<Radio value="1" checked> <Radio value="1" checked>
永不过期 永不过期
</Radio> </Radio>
</div> </div>
<div className={Styles.setDayView} style={{marginTop:"20px"}}> <div
className={Styles.setDayView}
style={{ marginTop: "20px" }}
>
<Radio value="3"> <Radio value="3">
<FormItem> <FormItem>
<span>设置周期:</span> <span>设置周期:</span>
{getFieldDecorator("validDays", { initialValue: 1 })( {getFieldDecorator("validDays", { initialValue: 1 })(
<InputNumber min={1} style={{marginLeft:"10px"}}/> <InputNumber min={1} style={{ marginLeft: "10px" }} />
)} )}
<span className="ant-form-text"></span> <span className="ant-form-text"></span>
</FormItem> </FormItem>
...@@ -369,7 +388,13 @@ class AddUser extends Component { ...@@ -369,7 +388,13 @@ class AddUser extends Component {
)} )}
</FormItem> </FormItem>
<FormItem> <FormItem>
<div style={{ display: "flex", justifyContent: "center",marginBottom:"20px" }}> <div
style={{
display: "flex",
justifyContent: "center",
marginBottom: "20px",
}}
>
<div> <div>
<Button <Button
type="default" type="default"
......
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
postPointAdd, postPointAdd,
postPointModify, postPointModify,
pointActivityDel, pointActivityDel,
getCodeList,
} from "./redux/action"; } from "./redux/action";
import Styles from "./index.less"; import Styles from "./index.less";
import ModalForm from "./ModalForm"; import ModalForm from "./ModalForm";
...@@ -41,7 +42,8 @@ class ActiveOption extends React.Component { ...@@ -41,7 +42,8 @@ class ActiveOption extends React.Component {
}; };
componentDidMount() { componentDidMount() {
this.props.getPointTable({pageNo: 1, pageSize: 20}); this.props.getPointTable({ pageNo: 1, pageSize: 20 });
this.props.getCodeList({ code: "point_activity" });
} }
//获取头部查询的值 //获取头部查询的值
onSearch = value => { onSearch = value => {
...@@ -108,6 +110,8 @@ class ActiveOption extends React.Component { ...@@ -108,6 +110,8 @@ class ActiveOption extends React.Component {
{ {
id: record.id, id: record.id,
activityName: values.activityName, activityName: values.activityName,
code: values.code,
activityType: values.activityType,
multiple: values.multiple, multiple: values.multiple,
startTime: values.time[0], startTime: values.time[0],
endTime: values.time[1], endTime: values.time[1],
...@@ -125,6 +129,8 @@ class ActiveOption extends React.Component { ...@@ -125,6 +129,8 @@ class ActiveOption extends React.Component {
this.props.postPointAdd( this.props.postPointAdd(
{ {
activityName: values.activityName, activityName: values.activityName,
code: values.code,
activityType: values.activityType,
multiple: values.multiple, multiple: values.multiple,
startTime: values.time[0], startTime: values.time[0],
endTime: values.time[1], endTime: values.time[1],
...@@ -157,13 +163,13 @@ class ActiveOption extends React.Component { ...@@ -157,13 +163,13 @@ class ActiveOption extends React.Component {
render() { render() {
const that = this; const that = this;
const { current, pageSize, activityName } = this.state; const { current, pageSize, activityName } = this.state;
const { table, getPointTable } = this.props; const { table, getPointTable, codeList } = this.props;
const columns = [ const columns = [
{ {
title: "活动策略名称", title: "活动策略名称",
dataIndex: "activityName", dataIndex: "activityName",
key: "activityName", key: "activityName",
width: 300, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug //width: 300, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render: text => { render: text => {
//bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
return ( return (
...@@ -184,10 +190,28 @@ class ActiveOption extends React.Component { ...@@ -184,10 +190,28 @@ class ActiveOption extends React.Component {
}, },
}, },
{ {
title: "积分编号",
dataIndex: "code",
key: "code",
// width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render: text => {
return codeList?.data?.find(item => item.code == text).cnName;
},
},
{
title: "积分类型",
dataIndex: "activityType",
key: "activityType",
// width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render: text => {
return <span>{text == "1" ? "否" : text}</span>;
},
},
{
title: "积分倍数", title: "积分倍数",
dataIndex: "multiple", dataIndex: "multiple",
key: "multiple", key: "multiple",
width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug // width: 200, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render: text => { render: text => {
return <span>{text == "1" ? "否" : text}</span>; return <span>{text == "1" ? "否" : text}</span>;
}, },
...@@ -196,7 +220,7 @@ class ActiveOption extends React.Component { ...@@ -196,7 +220,7 @@ class ActiveOption extends React.Component {
title: "发放有效期", title: "发放有效期",
dataIndex: "time", dataIndex: "time",
key: "time", key: "time",
width: 400, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug // width: 400, //bug-11246-liyuan 管理端-积分管理 -积分活动策略 UI bug
render: (text, record) => { render: (text, record) => {
return ( return (
<span> <span>
...@@ -302,7 +326,7 @@ class ActiveOption extends React.Component { ...@@ -302,7 +326,7 @@ class ActiveOption extends React.Component {
}; };
return ( return (
<div className={Styles.list}> <div className={Styles.list}>
<Breadcrumb title="活动策略设置"/> <Breadcrumb title="活动策略设置" />
<div className={Styles.listBtn}> <div className={Styles.listBtn}>
<div style={{ float: "left" }}> <div style={{ float: "left" }}>
<Button type="primary" onClick={this.showModal}> <Button type="primary" onClick={this.showModal}>
...@@ -333,6 +357,7 @@ class ActiveOption extends React.Component { ...@@ -333,6 +357,7 @@ class ActiveOption extends React.Component {
onCancel={this.handleCancel} onCancel={this.handleCancel}
onCreate={this.handleCreate} onCreate={this.handleCreate}
record={this.state.record} record={this.state.record}
codeList={this.props.codeList}
type={this.state.type} type={this.state.type}
/> />
</div> </div>
...@@ -343,12 +368,14 @@ class ActiveOption extends React.Component { ...@@ -343,12 +368,14 @@ class ActiveOption extends React.Component {
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
return { return {
table: state.point.table, table: state.point.table,
codeList: state.point.codeList,
}; };
} }
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
return { return {
getPointTable: obj => dispatch(getPointTable(obj)), getPointTable: obj => dispatch(getPointTable(obj)),
getCodeList: obj => dispatch(getCodeList(obj)),
postPointShelf: (obj, jsn, cb) => dispatch(postPointShelf(obj, jsn, cb)), postPointShelf: (obj, jsn, cb) => dispatch(postPointShelf(obj, jsn, cb)),
postPointShelves: (obj, jsn, cb) => postPointShelves: (obj, jsn, cb) =>
dispatch(postPointShelves(obj, jsn, cb)), dispatch(postPointShelves(obj, jsn, cb)),
......
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