题库路由调整

dev_aliyun_beta
杨树明 5 years ago
parent b918fc16d7
commit 0e35ef83ff

@ -296,7 +296,7 @@ class PollNewQuestbank extends Component {
title:'编辑', title:'编辑',
is_public:result && result.data && result.data.is_public, is_public:result && result.data && result.data.is_public,
crumbArray:[ crumbArray:[
{to:`/banks/poll/${pollid}`,content:'详情'}, {to:`/banks/poll/${pollid}/${this.props.match.params.type}`,content:'详情'},
{content:'编辑'} {content:'编辑'}
] ]
} }
@ -2683,7 +2683,7 @@ class PollNewQuestbank extends Component {
toWorkDetail = () => { toWorkDetail = () => {
// console.log(this.props); // console.log(this.props);
// console.log("toWorkDetail"); // console.log("toWorkDetail");
this.props.history.push(`/banks/poll/${this.props.match.params.workid}`); this.props.history.push(`/banks/poll/${this.props.match.params.workid}/${this.props.match.params.type}`);
// this.props.initPublic(undefined); // this.props.initPublic(undefined);
}; };
//跳转道描点的地方 //跳转道描点的地方

@ -520,12 +520,12 @@ class InfosTopics extends Component{
<div className="homepagePostSetting homepagePostSettingname topscisright"> <div className="homepagePostSetting homepagePostSettingname topscisright">
{types==="personal"?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) {types==="personal"?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&&<a className="btn colorblue mr25 font-16 fr" &&<a className="btn colorblue mr25 font-16 fr"
href={category==="normal"?`/banks/normal/${item.id}/edit`: href={category==="normal"?`/banks/normal/${item.id}/edit/${types}`:
category==="group"?`/banks/group/${item.id}/edit`: category==="group"?`/banks/group/${item.id}/edit/${types}`:
category==="poll"?`/banks/poll/${item.id}/edit`: category==="poll"?`/banks/poll/${item.id}/edit/${types}`:
category==="exercise"?`/banks/exercise/${item.id}/edit`: category==="exercise"?`/banks/exercise/${item.id}/edit/${types}`:
category==="gtask"?`/banks/gtask/${item.id}/edit`: category==="gtask"?`/banks/gtask/${item.id}/edit/${types}`:
category==="gtopic"?`/banks/gtopic/${item.id}/edit`:"" category==="gtopic"?`/banks/gtopic/${item.id}/edit/${types}`:""
} }
>编辑</a> >编辑</a>
:""} :""}

@ -117,14 +117,14 @@ class BanksIndex extends Component{
<Switch {...this.props}> <Switch {...this.props}>
{/*毕设任务编辑*/} {/*毕设任务编辑*/}
<Route path='/banks/gtask/:workId/edit' <Route path='/banks/gtask/:workId/edit/:type'
render={ render={
(props) => { (props) => {
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common}/>) return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
} }
}></Route> }></Route>
<Route path='/banks/normal/:workId/edit' <Route path='/banks/normal/:workId/edit/:type'
render={ render={
(props) => { (props) => {
return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common} return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common}
@ -133,7 +133,7 @@ class BanksIndex extends Component{
} }
}></Route> }></Route>
<Route path='/banks/group/:workId/edit' <Route path='/banks/group/:workId/edit/:type'
render={ render={
(props) => { (props) => {
return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common} return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common}
@ -142,7 +142,7 @@ class BanksIndex extends Component{
} }
}></Route> }></Route>
<Route path='/banks/exercise/:Id/edit' <Route path='/banks/exercise/:Id/edit/:type'
render={ render={
(props) => { (props) => {
return (<ExerciseBanksEdit {...this.props} {...props} {...this.state} {...common} return (<ExerciseBanksEdit {...this.props} {...props} {...this.state} {...common}
@ -151,7 +151,7 @@ class BanksIndex extends Component{
}></Route> }></Route>
<Route path='/banks/gtopic/:bankId/edit' <Route path='/banks/gtopic/:bankId/edit/:type'
render={ render={
(props) => { (props) => {
return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common}/>) return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
@ -160,7 +160,7 @@ class BanksIndex extends Component{
{/*题库问卷编辑详情*/} {/*题库问卷编辑详情*/}
<Route path="/banks/poll/:workid/edit" <Route path="/banks/poll/:workid/edit/:type"
render={ render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />) (props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />)
} }

@ -58,7 +58,7 @@ class BanksTabIndex extends Component{
></BanksMenu> ></BanksMenu>
} }
<Switch {...this.props}> <Switch {...this.props}>
<Route path='/banks/exercise/:Id' <Route path={`/banks/exercise/:Id/${this.props.match.params.type}`}
render={ render={
(props) => { (props) => {
return (<ExerciseBanksDetail {...this.props} {...props} {...this.state} {...common} return (<ExerciseBanksDetail {...this.props} {...props} {...this.state} {...common}
@ -66,13 +66,13 @@ class BanksTabIndex extends Component{
} }
}></Route> }></Route>
<Route path='/banks/gtopic/:bankId' <Route path={`/banks/gtopic/:bankId/${this.props.match.params.type}`}
render={ render={
(props) => { (props) => {
return (<GtopicBanks {...this.props} {...props} {...this.state} {...common} />) return (<GtopicBanks {...this.props} {...props} {...this.state} {...common} />)
} }
}></Route> }></Route>
<Route path='/banks/poll/:bankId' <Route path={`/banks/poll/:bankId/${this.props.match.params.type}`}
render={ render={
(props) => { (props) => {
return (<PollBanks {...this.props} {...props} {...this.state} {...common} />) return (<PollBanks {...this.props} {...props} {...this.state} {...common} />)

@ -27,10 +27,10 @@ class ExerciseBanksDetail extends Component{
const menuData={ const menuData={
tab:'0',//tab选中的index tab:'0',//tab选中的index
menuArray:[//tab以及tab路由 menuArray:[//tab以及tab路由
{to:`/banks/exercise/${Id}`,content:'内容详情'} {to:`/banks/exercise/${Id}/${this.props.match.params.type}`,content:'内容详情'}
], ],
category:'exercise',// category:'exercise',//
tos: `/banks/exercise/${Id}/edit`, tos: `/banks/exercise/${Id}/edit/${this.props.match.params.type}`,
id: Id, id: Id,
} }

@ -18,13 +18,13 @@ class ExerciseBanksEdit extends Component {
} }
initData = (responseData) =>{ initData = (responseData) =>{
const Id = this.props.match.params.Id const Id = this.props.match.params.Id;
const crumbData={ const crumbData={
title:'编辑', title:'编辑',
is_public: responseData && responseData.data && responseData.data.exercise.is_public, is_public: responseData && responseData.data && responseData.data.exercise.is_public,
crumbArray:[ crumbArray:[
{to:`/banks/exercise/${Id}`,content:'详情'}, {to:`/banks/exercise/${Id}/${this.props.match.params.type}`,content:'详情'},
{content:'编辑'} {content:'编辑'}
] ]
} }

@ -25,7 +25,7 @@ class GtaskBanksEdit extends Component {
title:'编辑', title:'编辑',
is_public:result && result.data && result.data.is_public, is_public:result && result.data && result.data.is_public,
crumbArray:[ crumbArray:[
{to:`/banks/gtask/${workId}/edit`,content:'详情'}, {to:`/banks/gtask/${workId}/${this.props.match.params.type}`,content:'详情'},
{content:'编辑'} {content:'编辑'}
] ]
} }
@ -59,7 +59,7 @@ class GtaskBanksEdit extends Component {
}); });
} }
toWorkDetail = () => { toWorkDetail = () => {
this.props.history.push(`/banks/gtask/${this.props.match.params.workId}`); this.props.history.push(`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}`);
this.props.initPublic(undefined); this.props.initPublic(undefined);
} }
onCancel = () => { onCancel = () => {

@ -24,7 +24,7 @@ class GtopicBanksEdit extends Component{
title:'编辑', title:'编辑',
is_public:result && result.data.selected_data && result.data.selected_data.is_public, is_public:result && result.data.selected_data && result.data.selected_data.is_public,
crumbArray:[ crumbArray:[
{to:`/banks/gtopic/${bankId}/edit`,content:'详情'}, {to:`/banks/gtopic/${bankId}/${this.props.match.params.type}`,content:'详情'},
{content:'编辑'} {content:'编辑'}
] ]
} }
@ -47,7 +47,7 @@ class GtopicBanksEdit extends Component{
axios.put(url,params).then((result)=>{ axios.put(url,params).then((result)=>{
if(result){ if(result){
this.props.showNotification('保存成功!'); this.props.showNotification('保存成功!');
this.props.history.push(`/banks/gtopic/${bankId}`); this.props.history.push(`/banks/gtopic/${bankId}/${this.props.match.params.type}`);
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -56,7 +56,7 @@ class GtopicBanksEdit extends Component{
// 取消 // 取消
editCancel = () =>{ editCancel = () =>{
this.props.history.push(`/banks/gtopic/${this.props.match.params.bankId}`); this.props.history.push(`/banks/gtopic/${this.props.match.params.bankId}/${this.props.match.params.type}`);
this.props.initPublic(undefined); this.props.initPublic(undefined);
} }

@ -26,7 +26,7 @@ class HomeworkBanksEdit extends Component {
title:'编辑', title:'编辑',
is_public:result && result.data && result.data.is_public, is_public:result && result.data && result.data.is_public,
crumbArray:[ crumbArray:[
{to:`/banks/${this.getModuleName()}/${workId}?tab=0`,content:'详情'}, {to:`/banks/${this.getModuleName()}/${workId}/${this.props.match.params.type}?tab=0`,content:'详情'},
{content:'编辑'} {content:'编辑'}
] ]
} }
@ -64,7 +64,7 @@ class HomeworkBanksEdit extends Component {
return this.props.isGroup ? 'group' : 'normal' return this.props.isGroup ? 'group' : 'normal'
} }
toWorkDetail = () => { toWorkDetail = () => {
this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}?tab=0`) this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`)
this.props.initPublic(undefined); this.props.initPublic(undefined);
} }
onCancel = () => { onCancel = () => {

@ -36,10 +36,10 @@ class PollBanksContent extends Component{
const menuData={ const menuData={
tab:'0',//tab选中的index tab:'0',//tab选中的index
menuArray:[//tab以及tab路由 menuArray:[//tab以及tab路由
{to:`/banks/poll/${bankId}`,content:'内容详情'} {to:`/banks/poll/${bankId}/${this.props.match.params.type}`,content:'内容详情'}
], ],
category:'poll',//毕设选题 category:'poll',//毕设选题
tos:`/banks/poll/${bankId}/edit`, tos:`/banks/poll/${bankId}/edit/${this.props.match.params.type}`,
id:bankId, id:bankId,
} }

Loading…
Cancel
Save