dev_forum
杨树明 6 years ago
parent d8fbe0678c
commit bc58fcd79d

@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative}
.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

@ -28,6 +28,14 @@ export function CNotificationHOC(options = {}) {
notification.open(data);
}
bytesToSize = (bytes) => {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
configNotification = (placement) => {
placement && notification.config({
placement: placement,
@ -127,6 +135,7 @@ export function CNotificationHOC(options = {}) {
</Modals>
<WrappedComponent {...this.props}
showNotification= { this.showNotification }
bytesToSize={this.bytesToSize}
getNowFormatDates={(value,type)=>this.getNowFormatDates(value,type)}
configNotification={ this.configNotification }
confirm={ this.confirm }

@ -431,7 +431,9 @@ class CoursesBanner extends Component {
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<Tooltip placement="bottom" title={
<pre>由教师/助教身份切换至学生<br/>可进行提交作品答题等操作</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
@ -439,7 +441,9 @@ class CoursesBanner extends Component {
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<Tooltip placement="bottom" title={
<pre>由学生身份切换至教师<br/>拥有添加成员发布作业等管理权限</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
@ -447,7 +451,9 @@ class CoursesBanner extends Component {
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<Tooltip placement="bottom" title={
<pre>由学生身份切换至助教<br/>拥有添加成员发布作业等管理权限</pre>
}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
@ -486,7 +492,9 @@ class CoursesBanner extends Component {
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span>
<span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span>
className={coursedata.credit===null?"color-white fl font-16 bannerurlis":"color-white fl font-16 bannerurli"}>
{coursedata.student_count}
</span>
</Link>
</li>
@ -550,7 +558,10 @@ class CoursesBanner extends Component {
{coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={
<pre>
coursedata.code_halt === true? <pre>
邀请码已停用<br/>
成员不能主动加入课堂
</pre>:<pre>
成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码
</pre>

@ -119,7 +119,17 @@ class Addcourses extends Component{
}
submitasyn=(course_id)=>{
let{professor}=this.state;
if(professor===1){
this.setState({
loadtype:true,
modalsType:true,
modalsTopval:"申请已提交,请等待审核",
modalSave:(course_id)=>this.submitasyns(course_id),
Addcoursestype:false
})
this.props.hideAddcoursestype();
}else{
// let{course_id}=this.state;
this.setState({
Addcoursestype:false
@ -128,6 +138,11 @@ class Addcourses extends Component{
window.location.href ="/courses/"+course_id+"/students";
}
}
submitasyns=(course_id)=>{
window.location.href ="/courses/"+course_id+"/students";
}
submittojoinclass=()=>{
let {invite_code,professor,assistant_professor,student}=this.state;
if(invite_code===undefined||invite_code===""){

@ -173,11 +173,11 @@ class PathModal extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
style={{width: '115%'}}
/>
</div>
</div>

@ -285,6 +285,11 @@ class Selectresource extends Component{
padding: 0 30px;
padding-top:30px;
}
.search-news{
width: 237px!important;
height: 30px;
margin-bottom: 30px;
}
`}</style>
<div className="newupload_conbox newupload_conboxtop">
@ -292,7 +297,7 @@ class Selectresource extends Component{
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5 ml15"> <a onClick={()=>this.changeTag("my")} className={ type==="my" ? " active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>我的资源</a></li>
<div className="fr search-new">
<div className="fr search-news" >
<Search
placeholder="请输入发布人或名称进行搜索"
value={Searchvalue}

@ -7,13 +7,7 @@ import moment from 'moment';
import Modals from '../../modals/Modals';
const Option = Select.Option;
function bytesToSize(bytes) {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
const dateFormat ="YYYY-MM-DD HH:mm"
function range(start, end) {
const result = [];
@ -619,7 +613,7 @@ class Selectsetting extends Component{
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)}
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}

@ -230,11 +230,11 @@ class ShixunModal extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
style={{width: '115%'}}
/>
</div>
</div>

@ -230,11 +230,11 @@ class ShixunModal extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
value={Searchvalue}
onInput={this.SenttotheValue}
onSearch={(value) => this.SenttotheSearch(value)}
style={{width: '100%'}}
style={{width: '115%'}}
/>
</div>
</div>

@ -22,13 +22,6 @@ function disabledDateTime() {
};
}
function bytesToSize(bytes) {
if (bytes === 0) return '0 B';
let k = 1024,
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)). toFixed(2) + ' ' + sizes[i];
}
const dateFormat="YYYY-MM-DD HH:mm";
class Sendresource extends Component{
constructor(props){
@ -456,7 +449,7 @@ class Sendresource extends Component{
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(bytesToSize(item.response.filesize))?"":bytesToSize(item.response.filesize)}
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}

@ -460,6 +460,10 @@ a.white-btn.use_scope-btn:hover{
width: 70px;
margin-left: -10px;
}
.bannerurlis{
width: 70px;
margin-left: -10px;
}
.pathInfobox li{
margin-right: 20px;
height: 15px;
@ -1206,6 +1210,7 @@ a.white-btn.use_scope-btn:hover{
width:237px!important;
height: 30px;
margin-bottom: 30px;
margin-right: 35px;
}
.search-new-input {
padding-left: 16px;

@ -212,7 +212,7 @@ class GraduationTasksSubmitedit extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
//onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
@ -228,14 +228,14 @@ class GraduationTasksSubmitedit extends Component{
// });
// return false;
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
ModalSave: ()=>this.deleteAttachment(file),
ModalCancel:this.cancelAttachment
})
return false;
}
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
//}
cancelAttachment=()=>{
this.setState({
@ -246,8 +246,8 @@ class GraduationTasksSubmitedit extends Component{
})
}
deleteAttachment = (file) => {
let {attachments}=this.state;
onAttachmentRemove = (file) => {
let {attachments,fileList}=this.state;
const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json`
axios.delete(url, {
})
@ -426,7 +426,7 @@ class GraduationTasksSubmitedit extends Component{
multiple: true,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -553,7 +553,37 @@ class GraduationTasksSubmitedit extends Component{
)
})}
<style>
{
`
.maxwidth500{
max-width:500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #05101a;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth500 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}

@ -7,6 +7,7 @@
width:237px!important;
height: 30px;
margin-bottom: 30px;
margin-right: 35px;
}
.search-new-input {
padding-left: 16px;

@ -461,9 +461,10 @@ class DetailCardsEditAndAdd extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>

@ -503,9 +503,10 @@ class DetailCardsEditAndEdit extends Component{
</span>
<div className="fr search-new">
<Search
placeholder="输入实训名称的关键字搜索"
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}
onSearch={()=>this.changeTag(`${type}`,`${search}`)}
style={{width: '115%'}}
></Search>
</div>
</div>

@ -183,10 +183,12 @@ export function TPMIndexHOC(WrappedComponent) {
// return false
return this.state.coursedata&&this.state.coursedata.course_identity === 0
}
// 管理员等
isAdminOrCreator = () => {
// return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 3
}
// 助教等
isAdminOrTeacher = () => {
// return this.state.coursedata&&this.state.coursedata.course_identity >= 0 &&
return this.state.coursedata&&this.state.coursedata.course_identity < 4

@ -296,7 +296,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.subshaicontent a{float: left;margin-right: 20px;color: #999;cursor: pointer}
.search-new{width: 248px;height:32px;position: relative}
.search-new{width: 248px;height:32px;position: relative;margin-right: 35px;}
.search-span{display: block;position: absolute;width: 100%;height: 100%;left:0px;top:0px;background-color: #F4F4F4;border: 1px solid #EAEAEA; border-radius: 4px;z-index: 1}
.search-new-input{height: 32px;padding-left: 5px;width: 225px;border: none;box-sizing: border-box;background: none;outline: none;position: absolute;left:0px;top:1px;z-index: 2}
.search-new img,.search-new a,.search-new .searchicon{cursor: pointer;position: absolute;right:2px;top:2px;z-index: 2}

Loading…
Cancel
Save