Commit 179bd7e0 authored by baixian's avatar baixian

复制

parent 734ef405
......@@ -37,7 +37,7 @@ export default {
activeurl: `${__IMGCDN__}menu/classactive.png`,
notactiveurl: `${__IMGCDN__}menu/class.png`,
path: '/sjd/classmgt',
relativePath: ['/sjd/classmgt', '/sjd/classdetail/:classid'],
relativePath: ['/sjd/classmgt', '/sjd/classdetail/:classid', '/sjd/newtheme/jobclock/:id', '/sjd/newtheme/calendarclock/:id', '/sjd/newtheme/jobclock/:id/:isCopy', '/sjd/newtheme/calendarclock/:id/:isCopy'],
},
{
id: '4',
......
import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { delay } from 'redux-saga';
import moment from 'moment';
import {
LocalStorage,
......@@ -27,7 +28,9 @@ export default {
jobParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
end_time: moment(moment().add(7, 'days')),
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
......@@ -50,7 +53,9 @@ export default {
calendarParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
end_time: moment(moment().add(7, 'days')),
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
......@@ -93,6 +98,7 @@ export default {
unlockSubjectList: [],
sortNumber: 1, // 闯关模式序号
isRelease: false, // 是否发布
isCopy: 0, // 0不复制 1 复制
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -110,66 +116,77 @@ export default {
},
* editGoTheme({ payload }, { call, put, select }) {
const { record } = payload;
console.log(record, 'record');
if (record.subject_type === 1) {
yield put({
type: 'updateState',
payload: {
jobParams: {
...record,
content: JSON.parse(record.content),
},
},
});
yield put({
type: 'updateState',
payload: {
tabIndex: record.subject_type,
record,
},
});
yield put(routerRedux.push({
pathname: `/sjd/newtheme/jobclock/${record.id}`,
}));
} else if (record.subject_type === 2) {
yield put({
type: 'updateState',
payload: {
calendarParams: {
...record,
content: JSON.parse(record.content),
yield put(routerRedux.push({
pathname: `/sjd/newtheme/calendarclock/${record.id}`,
}));
}
},
* copyGoTheme({ payload }, { call, put, select }) {
const { record, isCopy } = payload;
if (record.subject_type === 1) {
yield put(routerRedux.push({
pathname: `/sjd/newtheme/jobclock/${record.id}/${isCopy}`,
}));
} else if (record.subject_type === 2) {
yield put(routerRedux.push({
pathname: `/sjd/newtheme/calendarclock/${record.id}/${isCopy}`,
}));
}
},
* createThemeModalFind({ payload }, { call, put, select }) {
const { id, isCopy } = payload;
const { sid } = yield select(state => state.webapp);
const themeData = yield call(themeAjax.findTheme, {
id,
});
if (themeData.code == 200) {
themeData.data.content = JSON.parse(themeData.data.content);
if (themeData.data.subject_type === 1) {
yield put({
type: 'updateState',
payload: {
tabIndex: record.subject_type,
record,
jobParams: { ...themeData.data },
isCopy: isCopy || 0,
},
});
} else if (themeData.data.subject_type === 2) {
const { dateArray } = yield select(state => state.createtheme);
let editDates = [];
if (record.calendar_set.rest_dates != '') { editDates = record.calendar_set.rest_dates.split(','); }
let day = [];
if (themeData.data.calendar_set.rest_dates != '') { editDates = themeData.data.calendar_set.rest_dates.split(','); }
let day = '';
for (let i = 0; i < editDates.length; i++) {
editDates[i] = getDateStamp(editDates[i]);
editDates[i] = moment(editDates[i]).format('YYYY-MM-DD');
day = Number(getWeekDay(editDates[i]));
console.log(day, 'day');
dateArray.find(ele => ele.day == day).isChecked = true;
yield put({
type: 'chooseWeek',
type: 'selectPlanDay',
payload: {
day,
start_time: moment(record.start_time).format('YYYY-MM-DD'),
end_time: moment(record.end_time).format('YYYY-MM-DD'),
day: editDates[i],
},
});
}
yield put({
type: 'updateState',
payload: {
...dateArray,
rest_dates: [...editDates],
},
});
yield put({
type: 'updateState',
payload: {
calendarParams: { ...themeData.data },
isCopy: isCopy || 0,
},
});
}
}
yield put(routerRedux.push('/sjd/newtheme'));
},
* createThemeModalAdd({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
......@@ -180,6 +197,7 @@ export default {
calendarText,
calendarParams,
rest_dates,
isCopy,
} = yield select(state => state.createtheme);
if (payload.title.length > 20) {
message.error('标题长度不能超过20个字!', 1);
......@@ -237,7 +255,14 @@ export default {
...calendarParams,
};
}
const postFunction = (newParams.id != undefined) && newParams.id !== 0 ? themeAjax.editTheme : themeAjax.addTheme;
delete newParams.sort;
if (newParams.homework_set) {
delete newParams.homework_set;
}
if (newParams.calendar_set) {
delete newParams.calendar_set;
}
const postFunction = (newParams.id != undefined) && newParams.id !== 0 && (isCopy === 0) ? themeAjax.editTheme : themeAjax.addTheme;
const data = yield call(postFunction, Object.assign(newParams, {
is_cheat,
is_encrypt,
......@@ -276,13 +301,16 @@ export default {
});
setTimeout(loadmessage);
if (data.code === 200) {
message.success('保存成功', 0.5);
yield put({
type: 'updateState',
payload: {
jobParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
homework_set: {
......@@ -306,7 +334,9 @@ export default {
calendarParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
end_time: moment(moment().add(7, 'days')),
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
......@@ -342,7 +372,15 @@ export default {
if (callBack && (typeof callBack == 'function')) {
callBack();
}
message.success('保存成功', 0.5);
if ((newParams.id != undefined) && newParams.id !== 0) {
yield delay(500);
yield put(routerRedux.goBack());
} else {
yield delay(500);
yield put(routerRedux.push({
pathname: `/sjd/thememgt/${class_id}`,
}));
}
} else {
yield put({
type: 'webapp/errorrequestresolve',
......@@ -631,6 +669,48 @@ export default {
});
yield put(routerRedux.push('/sjd/newtheme'));
},
* jobMoveContent({ payload }, { call, put, select }) {
const { index, direction } = payload;
const { jobParams } = yield select(state => state.createtheme);
let newContent = [];
newContent = jobParams.content;
const currentImg = jobParams.content[index];
const preImg = jobParams.content[index - 1];
const afterImg = jobParams.content[index + 1];
if (direction == 'up') {
newContent.splice(index - 1, 2, currentImg, preImg);
} else if (direction == 'down') {
newContent.splice(index, 2, afterImg, currentImg);
}
jobParams.content = newContent;
yield put({
type: 'updateState',
payload: {
jobParams: { ...jobParams },
},
});
},
* calendarMoveContent({ payload }, { call, put, select }) {
const { index, direction } = payload;
const { calendarParams } = yield select(state => state.createtheme);
let newContent = [];
newContent = calendarParams.content;
const currentImg = calendarParams.content[index];
const preImg = calendarParams.content[index - 1];
const afterImg = calendarParams.content[index + 1];
if (direction == 'up') {
newContent.splice(index - 1, 2, currentImg, preImg);
} else if (direction == 'down') {
newContent.splice(index, 2, afterImg, currentImg);
}
calendarParams.content = newContent;
yield put({
type: 'updateState',
payload: {
calendarParams: { ...calendarParams },
},
});
},
* chooseWeek({ payload }, { call, put, select }) {
const {
day, start_time, end_time,
......@@ -1083,14 +1163,17 @@ export default {
yield put({
type: 'updateState',
payload: {
isCopy: 0,
sid: 0,
tabIndex: 1,
classList: [],
editorText: '',
tabIndex: 1,
jobParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
end_time: moment(moment().add(7, 'days')),
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
......@@ -1113,7 +1196,9 @@ export default {
calendarParams: {
is_cheat: 0,
title: '',
content: [],
content: [
{ type: 'text', value: '' },
],
is_encrypt: 0,
end_time: moment(moment().add(7, 'days')),
start_time: moment(moment(), 'YYYY/MM/DD HH:mm'),
......@@ -1134,6 +1219,26 @@ export default {
force_status: 2,
force_num: 0,
},
rest_dates: [],
dateArray: [
{ day: 1, title: '周一', isChecked: false },
{ day: 2, title: '周二', isChecked: false },
{ day: 3, title: '周三', isChecked: false },
{ day: 4, title: '周四', isChecked: false },
{ day: 5, title: '周五', isChecked: false },
{ day: 6, title: '周六', isChecked: false },
{ day: 0, title: '周日', isChecked: false },
],
calendarData: {},
currentTimestamp: 0,
selectPlanDays: [],
emigrateText: '',
emigrateParams: {
content: [],
},
unlockSubjectList: [],
sortNumber: 1, // 闯关模式序号
isRelease: false, // 是否发布
stepNumber: 0,
emigratedObj: {},
},
......
......@@ -482,6 +482,160 @@ export default {
},
});
}
const jobClockActive = pathToRegexp('/sjd/newtheme/jobclock/:id').exec(pathname);
if (jobClockActive) {
dispatch({
type: 'createtheme/createThemeModalFind',
payload: {
id: jobClockActive[1],
},
});
dispatch({
type: 'createtheme/queryClassList',
payload: {
},
});
dispatch({
type: 'createtheme/pageInit',
payload: {
},
});
dispatch({
type: 'webapp/updateState',
payload: {
breadcrumbList: [
{
path: 'sjd/classmgt',
name: '班级管理',
},
{
path: pathname,
name: '主题管理',
},
{
path: pathname,
name: '编辑作业打卡',
},
],
},
});
}
const jobClockCopyActive = pathToRegexp('/sjd/newtheme/jobclock/:id/:isCopy').exec(pathname);
if (jobClockCopyActive) {
dispatch({
type: 'createtheme/createThemeModalFind',
payload: {
id: jobClockCopyActive[1],
isCopy: jobClockCopyActive[2],
},
});
dispatch({
type: 'createtheme/queryClassList',
payload: {
},
});
dispatch({
type: 'createtheme/pageInit',
payload: {
},
});
dispatch({
type: 'webapp/updateState',
payload: {
breadcrumbList: [
{
path: 'sjd/classmgt',
name: '班级管理',
},
{
path: pathname,
name: '主题管理',
},
{
path: pathname,
name: '复制作业打卡',
},
],
},
});
}
const CalendarClockActive = pathToRegexp('/sjd/newtheme/calendarclock/:id').exec(pathname);
if (CalendarClockActive) {
dispatch({
type: 'createtheme/createThemeModalFind',
payload: {
id: CalendarClockActive[1],
},
});
dispatch({
type: 'createtheme/queryClassList',
payload: {
},
});
dispatch({
type: 'createtheme/pageInit',
payload: {
},
});
dispatch({
type: 'webapp/updateState',
payload: {
breadcrumbList: [
{
path: 'sjd/classmgt',
name: '班级管理',
},
{
path: pathname,
name: '主题管理',
},
{
path: pathname,
name: '编辑日历打卡',
},
],
},
});
}
const CalendarClockCopyActive = pathToRegexp('/sjd/newtheme/calendarclock/:id/:isCopy').exec(pathname);
if (CalendarClockCopyActive) {
dispatch({
type: 'createtheme/createThemeModalFind',
payload: {
id: CalendarClockCopyActive[1],
isCopy: CalendarClockCopyActive[2],
},
});
dispatch({
type: 'createtheme/queryClassList',
payload: {
},
});
dispatch({
type: 'createtheme/pageInit',
payload: {
},
});
dispatch({
type: 'webapp/updateState',
payload: {
breadcrumbList: [
{
path: 'sjd/classmgt',
name: '班级管理',
},
{
path: pathname,
name: '主题管理',
},
{
path: pathname,
name: '复制作业打卡',
},
],
},
});
}
const clockmgtactive = pathToRegexp('/sjd/clockmgt/:themetype/:classid/:themeid').exec(pathname);
if (clockmgtactive) {
dispatch({
......
......@@ -3,6 +3,7 @@ import React from 'react';
import { Icon, Divider, Tabs, Select, Form, Upload, Row, Col, Input, Radio, Modal, message } from 'antd';
import pageStyle from './ThemeEditor.less';
import { pageIn, hasBtnPower, imagify, ossVideofy } from '../../utils/index';
import upImg from '../../../image/subjectUp.png';
const { TabPane } = Tabs;
const { TextArea } = Input;
class ThemeEditor extends React.Component {
......@@ -31,10 +32,6 @@ class ThemeEditor extends React.Component {
previewVisible: false,
});
}
change = (e, index) => {
console.log(e.target.value, 'textValue12');
console.log(index, 'index');
}
render() {
const { previewVisible, previewImage } = this.state;
const {
......@@ -46,40 +43,64 @@ class ThemeEditor extends React.Component {
deleteThemeVideo,
editorText,
editorAddText,
moveContent,
} = this.props;
return (
<div className={pageStyle.container}>
{commentParams.content.map((item, index) => (
item.type === 'text' &&
<div className={pageStyle.editorwrap}>
{/* eslint-disable-next-line array-callback-return,consistent-return */}
{commentParams.content.map((item, index) => {
// eslint-disable-next-line default-case
switch (item.type) {
case 'text':
return (
<div className={pageStyle.textWrap}>
<TextArea autosize={{ minRows: 4, maxRows: 10 }} value={item.value} onChange={e => editorChange(e, index)} placeholder="请输入内容" style={{ width: 560 }} maxLength={500} />
<div className={pageStyle.sizeNumber}>{item.value.length}/500</div>
<div onClick={() => deleteThemeImg(index)} className={pageStyle.delete}><Icon type="close-circle" theme="filled" /></div>
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
))}
<div className={pageStyle.editorwrap}>
</div>
);
case 'img':
return (
<div className={pageStyle.uploadimgbox}>
{commentParams.content.map((item, index) => (
item.type === 'img' &&
<div className={pageStyle.imgwrap}>
<img alt={item.type} className={pageStyle.teacheruploadimg} src={imagify(item.value)} />
<div className={pageStyle.imghide}>
<a title="预览文件" onClick={() => this.priviewImg(item.value)} href="javascript:;" ><Icon style={{ color: '#fff' }} type="eye" /> 预览</a>
<Divider type="vertical" />
<a title="删除文件" onClick={() => deleteThemeImg(index)} href="javascript:;"> <Icon style={{ color: '#fff' }} type="delete" />删除</a>
</div>
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
</div>
))}
{commentParams.content.map((item, index) => (
item.type === 'video' &&
</div>
);
case 'video':
return (
<div className={pageStyle.videowrap}>
<video controls="controls" className={pageStyle.videoPoster} src={ossVideofy(item.value)} />
<div className={pageStyle.videohide}>
<a title="删除文件" onClick={() => deleteThemeImg(index)} href="javascript:;"> <Icon style={{ color: '#fff' }} type="delete" />删除</a>
</div>
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
{ index > 0 && <div className={pageStyle.up} onClick={() => moveContent(index, 'up')}><img src={upImg} alt="" /> </div> }
{ index === (commentParams.content.length - 1) && <div className={pageStyle.nodown}><img src={upImg} alt="" /> </div> }
{ index < (commentParams.content.length - 1) && <div className={pageStyle.down} onClick={() => moveContent(index, 'down')}><img src={upImg} alt="" /> </div> }
<div className={pageStyle.delete} onClick={() => deleteThemeImg(index)}><Icon type="delete" theme="filled" /></div>
</div>
))}
</div>
);
}
},
)}
</div>
<div className={pageStyle.uploadflex}>
<div className={pageStyle.uploadimg} onClick={editorAddText}><Icon style={{ marginRight: 10 }} type="font-size" />添加文字</div>
......
......@@ -2,6 +2,7 @@
width: 560px;
height: auto;
position: relative;
margin-bottom:10px;
:global {
.ant-input {
padding: 6px 15px 20px;
......@@ -12,38 +13,24 @@
bottom: 8px;
right: 10px;
}
.delete {
position: absolute;
top: 0;
right: 10px;
cursor: pointer;
color:#FF7373;
:global {
.anticon {
font-size: 20px;
}
}
}
}
.editorwrap {
width: 563px;
margin-top: 15px;
.uploadimgbox {
display: flex;
align-items: flex-end;
margin-bottom: 18px;
flex-wrap: wrap;
.imgwrap {
width: 135px;
height: 135px;
border-radius: 4px;
margin-right: 6px;
.videowrap {
width: 100%;
height: 120px;
position: relative;
margin-bottom: 10px;
.videoPoster {
width: 100%;
height: 100%;
}
.imgwrap:hover {
}
.videowrap:hover {
cursor: pointer;
.imghide {
.videohide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
......@@ -51,7 +38,7 @@
color: #fff;
}
}
.imghide {
.videohide {
position: absolute;
width: 100%;
height: 100%;
......@@ -67,26 +54,21 @@
color: #fff;
}
}
.teacheruploadimg {
.uploadimgbox {
display: flex;
align-items: flex-end;
margin-bottom: 18px;
flex-wrap: wrap;
.imgwrap {
width: 100%;
height: 100%;
height: 120px;
border-radius: 4px;
}
.teacheruploadimg:nth-child(4n){
margin-right: 0;
}
.videowrap {
width: 150px;
height: 150px;
margin-right: 6px;
position: relative;
.videoPoster {
width: 100%;
height: 100%;
}
}
.videowrap:hover {
.imgwrap:hover {
cursor: pointer;
.videohide {
.imghide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
......@@ -94,7 +76,7 @@
color: #fff;
}
}
.videohide {
.imghide {
position: absolute;
width: 100%;
height: 100%;
......@@ -110,6 +92,14 @@
color: #fff;
}
}
.teacheruploadimg {
width: 100%;
height: 100%;
border-radius: 4px;
}
.teacheruploadimg:nth-child(4n){
margin-right: 0;
}
}
}
......@@ -139,3 +129,48 @@
}
}
}
.toolList {
position: absolute;
right: -30px;
top: 0;
width: 30px;
height: 90px;
display: flex;
flex-direction: column;
background-color: #D3D3D3;
opacity: 0;
border-radius: 2px;
z-index: -1;
div {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
cursor: pointer;
}
div>img {
width: 14px;
height: 14px;
}
.up:hover {
background-color: #1890FF;
}
.down,.nodown {
transform: rotate(180deg);
}
.down:hover {
background-color: #1890FF;
}
.delete:hover {
background-color: #FF6060;
}
}
.textWrap:hover,.imgwrap:hover,.videowrap:hover {
.toolList {
opacity: 1;
z-index: 1;
}
}
......@@ -102,6 +102,7 @@ class CalendarClockForm extends React.Component {
form.resetFields();
this.setState({
title: '',
calendarShow: false,
});
},
},
......@@ -227,6 +228,16 @@ class CalendarClockForm extends React.Component {
},
});
}
calendarMoveContent = (index, direction) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/calendarMoveContent',
payload: {
index,
direction,
},
});
}
render() {
const { isShow, calendarShow, title } = this.state;
const {
......@@ -239,6 +250,7 @@ class CalendarClockForm extends React.Component {
calendarData,
currentTimestamp,
selectPlanDays,
isCopy,
} = this.props;
let new_rest_dates = [];
new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))];
......@@ -309,7 +321,7 @@ class CalendarClockForm extends React.Component {
},
],
})(
<Select disabled={!!calendarParams.class_id} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}>
<Select disabled={(calendarParams.class_id && calendarParams.class_id != undefined) && (isCopy === 0)} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>,
)}
......@@ -607,6 +619,7 @@ class CalendarClockForm extends React.Component {
editorChange={this.editorChange}
deleteThemeImg={this.deleteCalendarImg}
editorAddText={this.calendarAddText}
moveContent={this.calendarMoveContent}
/>
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
<Button type="primary" htmlType="submit" loading={themeAddLoading}>
......@@ -633,6 +646,7 @@ function mapStateToProps(state) {
calendarData,
currentTimestamp,
selectPlanDays,
isCopy,
} = state.createtheme;
return {
themeAddLoading,
......@@ -644,6 +658,7 @@ function mapStateToProps(state) {
calendarData,
currentTimestamp,
selectPlanDays,
isCopy,
};
}
export default connect(mapStateToProps)(CalendarClock);
......
.container {
background-color: #fff;
padding: 0 20px;
padding: 20px;
position: relative;
}
.title {
......
......@@ -13,6 +13,9 @@
.ant-tabs .ant-tabs-left-bar .ant-tabs-tab, .ant-tabs .ant-tabs-right-bar .ant-tabs-tab {
padding: 0;
}
.ant-tabs-bar {
margin-top: 20px;
}
.ant-tabs-nav-scroll {
border-right: 1px solid rgba(0, 0, 0, .1);
padding-right: 30px;
......
......@@ -175,6 +175,16 @@ class JobClockForm extends React.Component {
},
});
}
jobMoveContent = (index, direction) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/jobMoveContent',
payload: {
index,
direction,
},
});
}
render() {
const { isShow, title } = this.state;
const {
......@@ -183,6 +193,7 @@ class JobClockForm extends React.Component {
classList,
jobParams,
editorText,
isCopy,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -251,7 +262,7 @@ class JobClockForm extends React.Component {
},
],
})(
<Select disabled={!!jobParams.class_id} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}>
<Select disabled={(jobParams.class_id && jobParams.class_id != undefined) && (isCopy === 0)} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>,
)}
......@@ -444,6 +455,7 @@ class JobClockForm extends React.Component {
editorUploadAudio={this.jobUploadAudio}
editorChange={this.jobChangeSize}
deleteThemeImg={this.deleteJobImg}
moveContent={this.jobMoveContent}
editorAddText={this.jobAddText}
/>
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
......@@ -466,12 +478,14 @@ function mapStateToProps(state) {
classList,
jobParams,
editorText,
isCopy,
} = state.createtheme;
return {
themeAddLoading,
classList,
jobParams,
editorText,
isCopy,
};
}
export default connect(mapStateToProps)(JobClock);
......
.container {
background-color: #fff;
padding: 0 20px;
padding: 20px;
position: relative;
}
.title {
......
......@@ -138,7 +138,7 @@ class ThemeMgt extends React.Component {
editTheme = (record) => {
const { dispatch } = this.props;
if (record.subject_type == 3) {
message.error('闯关打卡暂时不支持编辑哟', 1);
message.warning('功能即将开放,敬请期待', 1);
return;
}
dispatch({
......@@ -148,6 +148,20 @@ class ThemeMgt extends React.Component {
},
});
}
copyClockMgt = (record, isCopy) => {
const { dispatch } = this.props;
if (record.subject_type == 3) {
message.warning('功能即将开放,敬请期待', 1);
return;
}
dispatch({
type: 'createtheme/copyGoTheme',
payload: {
record,
isCopy,
},
});
}
deleteTheme = (record) => {
const me = this;
const { dispatch } = me.props;
......@@ -279,6 +293,8 @@ class ThemeMgt extends React.Component {
<div className={pageStyle.tablecell}>
<a href="javascript:;" onClick={() => this.editTheme(record)}>编辑</a>
<Divider type="vertical" />
<a href="javascript:;" onClick={() => this.copyClockMgt(record, 1)}>复制</a>
<Divider type="vertical" />
<a href="javascript:;" onClick={() => this.goClockMgt(record)}>点评</a>
<Divider type="vertical" />
<a href="javascript:;" onClick={() => this.deleteTheme(record)}>删除</a>
......
......@@ -175,6 +175,16 @@ const RechargeDesc = props => (
{ RechargeDesc => (<RechargeDesc {...props} />) }
</Bundle>
);
const JobClock = props => (
<Bundle load={() => import(/* webpackChunkName:"JobClock" */'./pages/newtheme/jobclock/index')}>
{ JobClock => (<JobClock {...props} />) }
</Bundle>
);
const CalendarClock = props => (
<Bundle load={() => import(/* webpackChunkName:"JobClock" */'./pages/newtheme/calendarclock/index')}>
{ CalendarClock => (<CalendarClock {...props} />) }
</Bundle>
);
function RouterConfig({ history }) {
return (
<LocaleProvider locale={zhCN}>
......@@ -204,6 +214,10 @@ function RouterConfig({ history }) {
<Route path="/sjd/studentclass/:id" exact component={StudentClass} />
<Route path="/sjd/institutions" exact component={Institutions} />
<Route path="/sjd/schooledit" exact component={SchoolEdit} />
<Route path="/sjd/newtheme/jobclock/:id" exact component={JobClock} />
<Route path="/sjd/newtheme/jobclock/:id/:isCopy" exact component={JobClock} />
<Route path="/sjd/newtheme/calendarclock/:id" exact component={CalendarClock} />
<Route path="/sjd/newtheme/calendarclock/:id/:isCopy" exact component={CalendarClock} />
</SjdIndex>
)}
/>
......
import qs from 'qs';
import request from '../utils/request';
import api from '../common/api';
export function findTheme(params) {
const data = qs.stringify(params);
return request({
url: `${api.createtheme.addTheme}/${params.id}`,
method: 'GET',
data,
});
}
export function addTheme(params) {
const data = qs.stringify(params);
return request({
......
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