调整移动至 都加上默认提示

dev_aliyun_beta
杨树明 5 years ago
parent 680410923c
commit 00979e92b7

@ -838,7 +838,7 @@ class Fileslists extends Component{
{course_modules&&course_modules.course_modules.map((item,key)=>{
return(
filesId&&filesId===item.id?"":<li key={key} id={item.id} onClick={() => this.moveTos(0)}>{item.module_name}</li>
filesId&&filesId===item.id?"":<li key={key} id={item.id} onClick={() => this.moveTos(0)} title={item.module_name}>{item.module_name}</li>
)
})}
@ -848,7 +848,7 @@ class Fileslists extends Component{
return (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map((itm,k)=>{
return(
filesId&&filesId===itm.id?"":<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )}>{itm.name}</li>
filesId&&filesId===itm.id?"":<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )} title={itm.name}>{itm.name}</li>
)
})
})}

@ -387,7 +387,7 @@ class Boards extends Component{
boards && boards.filter((item)=> {
return item.id != bid && (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item) => {
return <li onClick={() => this.moveTo(item)}>{item.name}</li>
return <li onClick={() => this.moveTo(item)} title={item.name}>{item.name}</li>
})
}
{ isAdmin &&

@ -650,7 +650,7 @@ class studentsList extends Component{
return item.id != course_group_id && (!this.state.groupSearchValue || item.name.indexOf(this.state.groupSearchValue) != -1)
}).map( item => {
return (
<li key={item.id} onClick={() => this.moveToGroup(item)}>{item.name}</li>
<li key={item.id} onClick={() => this.moveToGroup(item)} title={item.name}>{item.name}</li>
)
}) }
{ isAdmin &&

@ -1100,7 +1100,7 @@ class ShixunHomework extends Component{
{course_modules&&course_modules.main_category.map((item,key)=>{
return(
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)}>{item.main_category_name}</li>
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)} title={item.main_category_name}>{item.main_category_name}</li>
)
})}
@ -1109,10 +1109,10 @@ class ShixunHomework extends Component{
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => {
if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li>
}
if(datas&&datas.category_id===null){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li>
}
})}

@ -4,139 +4,43 @@ import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css";
import axios from 'axios';
import {getUrl} from 'educoder';
let origin = getUrl();
let path = getUrl("/editormd/lib/")
const $ = window.$;
let timeout;
let currentValue;
const Option = Select.Option;
const RadioGroup = Radio.Group;
function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
var editorName = window.editormd(id, {
width: width,
height: high,
path: path, // "/editormd/lib/"
syncScrolling: "single",
tex: true,
tocm: true,
emoji: true,
taskList: true,
codeFold: true,
searchReplace: true,
htmlDecode: "style,script,iframe",
sequenceDiagram: true,
autoFocus: false,
toolbarIcons: function () {
// Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
},
toolbarCustomIcons: {
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
},
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea: true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity: 0.6,
placeholder: placeholder,
imageUpload: true,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL: imageUrl,//url
onload: function () {
// this.previewing();
$("#" + id + " [type=\"latex\"]").bind("click", function () {
editorName.cm.replaceSelection("```latex");
editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("\n");
editorName.cm.replaceSelection("```");
var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line - 1, 0);
});
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
$("#" + id + " [type=\"inline\"]").bind("click", function () {
editorName.cm.replaceSelection("$$$$");
var __Cursor = editorName.cm.getDoc().getCursor();
editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
editorName.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式");
window.md_elocalStorage(editorName, `UpdatepropaedeMDs_${id}`, "UpdatepropaedeMDs");
import {getUrl} from 'educoder';
callback && callback()
}
});
return editorName;
}
export default class TPMUpdatepropaede extends Component {
constructor(props) {
super(props)
this.neweditanswerRef=React.createRef();
this.state = {
shixunId:undefined
}
}
updatepropaedeMD(initValue, id) {
this.contentChanged = false;
const placeholder = "";
// amp;
// 编辑时要传memoId
const imageUrl = `/api/attachments.json`;
// 创建editorMd
const Updatepropaede_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {
setTimeout(() => {
Updatepropaede_editormd.resize()
Updatepropaede_editormd.cm && Updatepropaede_editormd.cm.refresh()
}, 500)
if (initValue != undefined) {
Updatepropaede_editormd.setValue(initValue)
shixunId:undefined,
}
Updatepropaede_editormd.cm.on("change", (_cm, changeObj) => {
console.log('....contentChanged')
this.contentChanged = true;
})
});
this.Updatepropaede_editormd = Updatepropaede_editormd;
window.Updatepropaede_editormd = Updatepropaede_editormd;
}
componentDidMount() {
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/propaedeutics.json";
axios.get(url).then((response) => {
console.log(response)
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
this.setState({
shixunId:id
shixunId:id,
})
if(response.data.content[0]!=null){
this.updatepropaedeMD(response.data.content, "UpdatepropaedeMD");
this.setState({
editanswersRefval:response.data.content,
})
this.neweditanswerRef.current.setValue(response.data.content)
}else{
this.updatepropaedeMD("", "UpdatepropaedeMD");
this.setState({
editanswersRefval:"",
})
this.neweditanswerRef.current.setValue('')
}
}
}).catch((error) => {
@ -148,7 +52,7 @@ export default class TPMUpdatepropaede extends Component {
updatepropaedeuticsvalue=()=>{
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/update_propaedeutics.json";
const update_propaedeuticsvalue = this.Updatepropaede_editormd.getValue();
const update_propaedeuticsvalue = this.editanswersRef.current.getValue().trim();
axios.post(url,{
content:update_propaedeuticsvalue
}
@ -163,10 +67,7 @@ export default class TPMUpdatepropaede extends Component {
});
}
render() {
let {shixunId} = this.state;
return (
<React.Fragment>
<div className="educontent">
@ -178,11 +79,8 @@ export default class TPMUpdatepropaede extends Component {
</div>
<div className="padding40-20">
<div className="padding10-20 edu-back-greyf5 radius4" id="UpdatepropaedeMD">
<textarea style={{display: 'none'}} id="Updatepropaedes" name="content"> </textarea>
<div className="CodeMirror cm-s-defualt">
</div>
</div>
<TPMMDEditor ref={this.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'editquestioMDid'} refreshTimeout={1500}
needRecreate={true} watch={true} className="courseMessageMD" initValue={this.neweditanswerRefval}></TPMMDEditor>
</div>
</div>

Loading…
Cancel
Save