Merge branches 'dev_aliyun' and 'dev_aliyun_beta' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_aliyun_beta
杨树明 5 years ago
commit 44c7465a1a

@ -1,403 +1,403 @@
/*!
* jQuery cxSelect
* @name jquery.cxselect.js
* @version 1.4.1
* @date 2016-11-02
* @author ciaoca
* @email ciaoca@gmail.com
* @site https://github.com/ciaoca/cxSelect
* @license Released under the MIT license
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(window.jQuery || window.Zepto || window.$);
};
}(function($) {
var cxSelect = function() {
var self = this;
var dom, settings, callback;
// 分配参数
for (var i = 0, l = arguments.length; i < l; i++) {
if (cxSelect.isJquery(arguments[i]) || cxSelect.isZepto(arguments[i])) {
dom = arguments[i];
} else if (cxSelect.isElement(arguments[i])) {
dom = $(arguments[i]);
} else if (typeof arguments[i] === 'function') {
callback = arguments[i];
} else if (typeof arguments[i] === 'object') {
settings = arguments[i];
};
};
var api = new cxSelect.init(dom, settings);
if (typeof callback === 'function') {
callback(api);
};
return api;
};
cxSelect.isElement = function(o){
if (o && (typeof HTMLElement === 'function' || typeof HTMLElement === 'object') && o instanceof HTMLElement) {
return true;
} else {
return (o && o.nodeType && o.nodeType === 1) ? true : false;
};
};
cxSelect.isJquery = function(o){
return (o && o.length && (typeof jQuery === 'function' || typeof jQuery === 'object') && o instanceof jQuery) ? true : false;
};
cxSelect.isZepto = function(o){
return (o && o.length && (typeof Zepto === 'function' || typeof Zepto === 'object') && Zepto.zepto.isZ(o)) ? true : false;
};
cxSelect.getIndex = function(n, required) {
return required ? n : n - 1;
};
cxSelect.getData = function(data, space) {
if (typeof space === 'string' && space.length) {
space = space.split('.');
for (var i = 0, l = space.length; i < l; i++) {
data = data[space[i]];
};
};
return data;
};
cxSelect.init = function(dom, settings) {
var self = this;
if (!cxSelect.isJquery(dom) && !cxSelect.isZepto(dom)) {return};
var theSelect = {
dom: {
box: dom
}
};
self.attach = cxSelect.attach.bind(theSelect);
self.detach = cxSelect.detach.bind(theSelect);
self.setOptions = cxSelect.setOptions.bind(theSelect);
self.clear = cxSelect.clear.bind(theSelect);
theSelect.changeEvent = function() {
cxSelect.selectChange.call(theSelect, this.className);
};
theSelect.settings = $.extend({}, $.cxSelect.defaults, settings, {
url: theSelect.dom.box.data('url'),
emptyStyle: theSelect.dom.box.data('emptyStyle'),
required: theSelect.dom.box.data('required'),
firstTitle: theSelect.dom.box.data('firstTitle'),
firstValue: theSelect.dom.box.data('firstValue'),
jsonSpace: theSelect.dom.box.data('jsonSpace'),
jsonName: theSelect.dom.box.data('jsonName'),
jsonValue: theSelect.dom.box.data('jsonValue'),
jsonSub: theSelect.dom.box.data('jsonSub')
});
var _dataSelects = theSelect.dom.box.data('selects');
if (typeof _dataSelects === 'string' && _dataSelects.length) {
theSelect.settings.selects = _dataSelects.split(',');
};
self.setOptions();
self.attach();
// 使用独立接口获取数据
if (!theSelect.settings.url && !theSelect.settings.data) {
cxSelect.start.apply(theSelect);
// 设置自定义数据
} else if ($.isArray(theSelect.settings.data)) {
cxSelect.start.call(theSelect, theSelect.settings.data);
// 设置 URL通过 Ajax 获取数据
} else if (typeof theSelect.settings.url === 'string' && theSelect.settings.url.length) {
$.getJSON(theSelect.settings.url, function(json) {
cxSelect.start.call(theSelect, json);
});
};
};
// 设置参数
cxSelect.setOptions = function(opts) {
var self = this;
if (opts) {
$.extend(self.settings, opts);
};
// 初次或重设选择器组
if (!$.isArray(self.selectArray) || !self.selectArray.length || (opts && opts.selects)) {
self.selectArray = [];
if ($.isArray(self.settings.selects) && self.settings.selects.length) {
var _tempSelect;
for (var i = 0, l = self.settings.selects.length; i < l; i++) {
_tempSelect = self.dom.box.find('select.' + self.settings.selects[i]);
if (!_tempSelect || !_tempSelect.length) {break};
self.selectArray.push(_tempSelect);
};
};
};
if (opts) {
if (!$.isArray(opts.data) && typeof opts.url === 'string' && opts.url.length) {
$.getJSON(self.settings.url, function(json) {
cxSelect.start.call(self, json);
});
} else {
cxSelect.start.call(self, opts.data);
};
};
};
// 绑定
cxSelect.attach = function() {
var self = this;
if (!self.attachStatus) {
self.dom.box.on('change', 'select', self.changeEvent);
};
if (typeof self.attachStatus === 'boolean') {
cxSelect.start.call(self);
};
self.attachStatus = true;
};
// 移除绑定
cxSelect.detach = function() {
var self = this;
self.dom.box.off('change', 'select', self.changeEvent);
self.attachStatus = false;
};
// 清空选项
cxSelect.clear = function(index) {
var self = this;
var _style = {
display: '',
visibility: ''
};
index = isNaN(index) ? 0 : index;
// 清空后面的 select
for (var i = index, l = self.selectArray.length; i < l; i++) {
self.selectArray[i].empty().prop('disabled', true);
if (self.settings.emptyStyle === 'none') {
_style.display = 'none';
} else if (self.settings.emptyStyle === 'hidden') {
_style.visibility = 'hidden';
};
self.selectArray[i].css(_style);
};
};
cxSelect.start = function(data) {
var self = this;
if ($.isArray(data)) {
self.settings.data = cxSelect.getData(data, self.settings.jsonSpace);
};
if (!self.selectArray.length) {return};
// 保存默认值
for (var i = 0, l = self.selectArray.length; i < l; i++) {
if (typeof self.selectArray[i].attr('data-value') !== 'string' && self.selectArray[i][0].options.length) {
self.selectArray[i].attr('data-value', self.selectArray[i].val());
};
};
if (self.settings.data || (typeof self.selectArray[0].data('url') === 'string' && self.selectArray[0].data('url').length)) {
cxSelect.getOptionData.call(self, 0);
} else {
self.selectArray[0].prop('disabled', false).css({
'display': '',
'visibility': ''
});
};
};
// 获取选项数据
cxSelect.getOptionData = function(index) {
var self = this;
if (typeof index !== 'number' || isNaN(index) || index < 0 || index >= self.selectArray.length) {return};
var _indexPrev = index - 1;
var _select = self.selectArray[index];
var _selectData;
var _valueIndex;
var _dataUrl = _select.data('url');
var _jsonSpace = typeof _select.data('jsonSpace') === 'undefined' ? self.settings.jsonSpace : _select.data('jsonSpace');
var _query = {};
var _queryName;
var _selectName;
var _selectValue;
cxSelect.clear.call(self, index);
// 使用独立接口
if (typeof _dataUrl === 'string' && _dataUrl.length) {
if (index > 0) {
for (var i = 0, j = 1; i < index; i++, j++) {
_queryName = self.selectArray[j].data('queryName');
_selectName = self.selectArray[i].attr('name');
_selectValue = self.selectArray[i].val();
if (typeof _queryName === 'string' && _queryName.length) {
_query[_queryName] = _selectValue;
} else if (typeof _selectName === 'string' && _selectName.length) {
_query[_selectName] = _selectValue;
};
};
};
$.getJSON(_dataUrl, _query, function(json) {
_selectData = cxSelect.getData(json, _jsonSpace);
cxSelect.buildOption.call(self, index, _selectData);
});
// 使用整合数据
} else if (self.settings.data && typeof self.settings.data === 'object') {
_selectData = self.settings.data;
for (var i = 0; i < index; i++) {
_valueIndex = cxSelect.getIndex(self.selectArray[i][0].selectedIndex, typeof self.selectArray[i].data('required') === 'boolean' ? self.selectArray[i].data('required') : self.settings.required);
if (typeof _selectData[_valueIndex] === 'object' && $.isArray(_selectData[_valueIndex][self.settings.jsonSub]) && _selectData[_valueIndex][self.settings.jsonSub].length) {
_selectData = _selectData[_valueIndex][self.settings.jsonSub];
} else {
_selectData = null;
break;
};
};
cxSelect.buildOption.call(self, index, _selectData);
};
};
// 构建选项列表
cxSelect.buildOption = function(index, data) {
var self = this;
var _select = self.selectArray[index];
var _required = typeof _select.data('required') === 'boolean' ? _select.data('required') : self.settings.required;
var _firstTitle = typeof _select.data('firstTitle') === 'undefined' ? self.settings.firstTitle : _select.data('firstTitle');
var _firstValue = typeof _select.data('firstValue') === 'undefined' ? self.settings.firstValue : _select.data('firstValue');
var _jsonName = typeof _select.data('jsonName') === 'undefined' ? self.settings.jsonName : _select.data('jsonName');
var _jsonValue = typeof _select.data('jsonValue') === 'undefined' ? self.settings.jsonValue : _select.data('jsonValue');
if (!$.isArray(data)) {return};
var _html = !_required ? '<option value="' + String(_firstValue) + '">' + String(_firstTitle) + '</option>' : '';
// 区分标题、值的数据
if (typeof _jsonName === 'string' && _jsonName.length) {
// 无值字段时使用标题作为值
if (typeof _jsonValue !== 'string' || !_jsonValue.length) {
_jsonValue = _jsonName;
};
for (var i = 0, l = data.length; i < l; i++) {
_html += '<option value="' + String(data[i][_jsonValue]) + '">' + String(data[i][_jsonName]) + '</option>';
};
// 数组即为值的数据
} else {
for (var i = 0, l = data.length; i < l; i++) {
_html += '<option value="' + String(data[i]) + '">' + String(data[i]) + '</option>';
};
};
_select.html(_html).prop('disabled', false).css({
'display': '',
'visibility': ''
});
// 初次加载设置默认值
if (typeof _select.attr('data-value') === 'string') {
_select.val(String(_select.attr('data-value'))).removeAttr('data-value');
if (_select[0].selectedIndex < 0) {
_select[0].options[0].selected = true;
};
};
if (_required || _select[0].selectedIndex > 0) {
_select.trigger('change');
};
};
// 改变选择时的处理
cxSelect.selectChange = function(name) {
var self = this;
if (typeof name !== 'string' || !name.length) {return};
var index;
name = name.replace(/\s+/g, ',');
name = ',' + name + ',';
// 获取当前 select 位置
for (var i = 0, l = self.selectArray.length; i < l; i++) {
if (name.indexOf(',' + self.settings.selects[i] + ',') > -1) {
index = i;
break;
};
};
if (typeof index === 'number' && index > -1) {
index += 1;
cxSelect.getOptionData.call(self, index);
};
};
$.cxSelect = function() {
return cxSelect.apply(this, arguments);
};
// 默认值
$.cxSelect.defaults = {
selects: [], // 下拉选框组
url: null, // 列表数据文件路径URL或数组数据
data: null, // 自定义数据
emptyStyle: null, // 无数据状态显示方式
required: false, // 是否为必选
firstTitle: '请选择', // 第一个选项的标题
firstValue: '', // 第一个选项的值
jsonSpace: '', // 数据命名空间
jsonName: 'n', // 数据标题字段名称
jsonValue: '', // 数据值字段名称
jsonSub: 's' // 子集数据字段名称
};
$.fn.cxSelect = function(settings, callback) {
this.each(function(i) {
$.cxSelect(this, settings, callback);
});
return this;
};
}));
/*!
* jQuery cxSelect
* @name jquery.cxselect.js
* @version 1.4.1
* @date 2016-11-02
* @author ciaoca
* @email ciaoca@gmail.com
* @site https://github.com/ciaoca/cxSelect
* @license Released under the MIT license
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(window.jQuery || window.Zepto || window.$);
};
}(function($) {
var cxSelect = function() {
var self = this;
var dom, settings, callback;
// 分配参数
for (var i = 0, l = arguments.length; i < l; i++) {
if (cxSelect.isJquery(arguments[i]) || cxSelect.isZepto(arguments[i])) {
dom = arguments[i];
} else if (cxSelect.isElement(arguments[i])) {
dom = $(arguments[i]);
} else if (typeof arguments[i] === 'function') {
callback = arguments[i];
} else if (typeof arguments[i] === 'object') {
settings = arguments[i];
};
};
var api = new cxSelect.init(dom, settings);
if (typeof callback === 'function') {
callback(api);
};
return api;
};
cxSelect.isElement = function(o){
if (o && (typeof HTMLElement === 'function' || typeof HTMLElement === 'object') && o instanceof HTMLElement) {
return true;
} else {
return (o && o.nodeType && o.nodeType === 1) ? true : false;
};
};
cxSelect.isJquery = function(o){
return (o && o.length && (typeof jQuery === 'function' || typeof jQuery === 'object') && o instanceof jQuery) ? true : false;
};
cxSelect.isZepto = function(o){
return (o && o.length && (typeof Zepto === 'function' || typeof Zepto === 'object') && Zepto.zepto.isZ(o)) ? true : false;
};
cxSelect.getIndex = function(n, required) {
return required ? n : n - 1;
};
cxSelect.getData = function(data, space) {
if (typeof space === 'string' && space.length) {
space = space.split('.');
for (var i = 0, l = space.length; i < l; i++) {
data = data[space[i]];
};
};
return data;
};
cxSelect.init = function(dom, settings) {
var self = this;
if (!cxSelect.isJquery(dom) && !cxSelect.isZepto(dom)) {return};
var theSelect = {
dom: {
box: dom
}
};
self.attach = cxSelect.attach.bind(theSelect);
self.detach = cxSelect.detach.bind(theSelect);
self.setOptions = cxSelect.setOptions.bind(theSelect);
self.clear = cxSelect.clear.bind(theSelect);
theSelect.changeEvent = function() {
cxSelect.selectChange.call(theSelect, this.className);
};
theSelect.settings = $.extend({}, $.cxSelect.defaults, settings, {
url: theSelect.dom.box.data('url'),
emptyStyle: theSelect.dom.box.data('emptyStyle'),
required: theSelect.dom.box.data('required'),
firstTitle: theSelect.dom.box.data('firstTitle'),
firstValue: theSelect.dom.box.data('firstValue'),
jsonSpace: theSelect.dom.box.data('jsonSpace'),
jsonName: theSelect.dom.box.data('jsonName'),
jsonValue: theSelect.dom.box.data('jsonValue'),
jsonSub: theSelect.dom.box.data('jsonSub')
});
var _dataSelects = theSelect.dom.box.data('selects');
if (typeof _dataSelects === 'string' && _dataSelects.length) {
theSelect.settings.selects = _dataSelects.split(',');
};
self.setOptions();
self.attach();
// 使用独立接口获取数据
if (!theSelect.settings.url && !theSelect.settings.data) {
cxSelect.start.apply(theSelect);
// 设置自定义数据
} else if ($.isArray(theSelect.settings.data)) {
cxSelect.start.call(theSelect, theSelect.settings.data);
// 设置 URL通过 Ajax 获取数据
} else if (typeof theSelect.settings.url === 'string' && theSelect.settings.url.length) {
$.getJSON(theSelect.settings.url, function(json) {
cxSelect.start.call(theSelect, json);
});
};
};
// 设置参数
cxSelect.setOptions = function(opts) {
var self = this;
if (opts) {
$.extend(self.settings, opts);
};
// 初次或重设选择器组
if (!$.isArray(self.selectArray) || !self.selectArray.length || (opts && opts.selects)) {
self.selectArray = [];
if ($.isArray(self.settings.selects) && self.settings.selects.length) {
var _tempSelect;
for (var i = 0, l = self.settings.selects.length; i < l; i++) {
_tempSelect = self.dom.box.find('select.' + self.settings.selects[i]);
if (!_tempSelect || !_tempSelect.length) {break};
self.selectArray.push(_tempSelect);
};
};
};
if (opts) {
if (!$.isArray(opts.data) && typeof opts.url === 'string' && opts.url.length) {
$.getJSON(self.settings.url, function(json) {
cxSelect.start.call(self, json);
});
} else {
cxSelect.start.call(self, opts.data);
};
};
};
// 绑定
cxSelect.attach = function() {
var self = this;
if (!self.attachStatus) {
self.dom.box.on('change', 'select', self.changeEvent);
};
if (typeof self.attachStatus === 'boolean') {
cxSelect.start.call(self);
};
self.attachStatus = true;
};
// 移除绑定
cxSelect.detach = function() {
var self = this;
self.dom.box.off('change', 'select', self.changeEvent);
self.attachStatus = false;
};
// 清空选项
cxSelect.clear = function(index) {
var self = this;
var _style = {
display: '',
visibility: ''
};
index = isNaN(index) ? 0 : index;
// 清空后面的 select
for (var i = index, l = self.selectArray.length; i < l; i++) {
self.selectArray[i].empty().prop('disabled', true);
if (self.settings.emptyStyle === 'none') {
_style.display = 'none';
} else if (self.settings.emptyStyle === 'hidden') {
_style.visibility = 'hidden';
};
self.selectArray[i].css(_style);
};
};
cxSelect.start = function(data) {
var self = this;
if ($.isArray(data)) {
self.settings.data = cxSelect.getData(data, self.settings.jsonSpace);
};
if (!self.selectArray.length) {return};
// 保存默认值
for (var i = 0, l = self.selectArray.length; i < l; i++) {
if (typeof self.selectArray[i].attr('data-value') !== 'string' && self.selectArray[i][0].options.length) {
self.selectArray[i].attr('data-value', self.selectArray[i].val());
};
};
if (self.settings.data || (typeof self.selectArray[0].data('url') === 'string' && self.selectArray[0].data('url').length)) {
cxSelect.getOptionData.call(self, 0);
} else {
self.selectArray[0].prop('disabled', false).css({
'display': '',
'visibility': ''
});
};
};
// 获取选项数据
cxSelect.getOptionData = function(index) {
var self = this;
if (typeof index !== 'number' || isNaN(index) || index < 0 || index >= self.selectArray.length) {return};
var _indexPrev = index - 1;
var _select = self.selectArray[index];
var _selectData;
var _valueIndex;
var _dataUrl = _select.data('url');
var _jsonSpace = typeof _select.data('jsonSpace') === 'undefined' ? self.settings.jsonSpace : _select.data('jsonSpace');
var _query = {};
var _queryName;
var _selectName;
var _selectValue;
cxSelect.clear.call(self, index);
// 使用独立接口
if (typeof _dataUrl === 'string' && _dataUrl.length) {
if (index > 0) {
for (var i = 0, j = 1; i < index; i++, j++) {
_queryName = self.selectArray[j].data('queryName');
_selectName = self.selectArray[i].attr('name');
_selectValue = self.selectArray[i].val();
if (typeof _queryName === 'string' && _queryName.length) {
_query[_queryName] = _selectValue;
} else if (typeof _selectName === 'string' && _selectName.length) {
_query[_selectName] = _selectValue;
};
};
};
$.getJSON(_dataUrl, _query, function(json) {
_selectData = cxSelect.getData(json, _jsonSpace);
cxSelect.buildOption.call(self, index, _selectData);
});
// 使用整合数据
} else if (self.settings.data && typeof self.settings.data === 'object') {
_selectData = self.settings.data;
for (var i = 0; i < index; i++) {
_valueIndex = cxSelect.getIndex(self.selectArray[i][0].selectedIndex, typeof self.selectArray[i].data('required') === 'boolean' ? self.selectArray[i].data('required') : self.settings.required);
if (typeof _selectData[_valueIndex] === 'object' && $.isArray(_selectData[_valueIndex][self.settings.jsonSub]) && _selectData[_valueIndex][self.settings.jsonSub].length) {
_selectData = _selectData[_valueIndex][self.settings.jsonSub];
} else {
_selectData = null;
break;
};
};
cxSelect.buildOption.call(self, index, _selectData);
};
};
// 构建选项列表
cxSelect.buildOption = function(index, data) {
var self = this;
var _select = self.selectArray[index];
var _required = typeof _select.data('required') === 'boolean' ? _select.data('required') : self.settings.required;
var _firstTitle = typeof _select.data('firstTitle') === 'undefined' ? self.settings.firstTitle : _select.data('firstTitle');
var _firstValue = typeof _select.data('firstValue') === 'undefined' ? self.settings.firstValue : _select.data('firstValue');
var _jsonName = typeof _select.data('jsonName') === 'undefined' ? self.settings.jsonName : _select.data('jsonName');
var _jsonValue = typeof _select.data('jsonValue') === 'undefined' ? self.settings.jsonValue : _select.data('jsonValue');
if (!$.isArray(data)) {return};
var _html = !_required ? '<option value="' + String(_firstValue) + '">' + String(_firstTitle) + '</option>' : '';
// 区分标题、值的数据
if (typeof _jsonName === 'string' && _jsonName.length) {
// 无值字段时使用标题作为值
if (typeof _jsonValue !== 'string' || !_jsonValue.length) {
_jsonValue = _jsonName;
};
for (var i = 0, l = data.length; i < l; i++) {
_html += '<option value="' + String(data[i][_jsonValue]) + '">' + String(data[i][_jsonName]) + '</option>';
};
// 数组即为值的数据
} else {
for (var i = 0, l = data.length; i < l; i++) {
_html += '<option value="' + String(data[i]) + '">' + String(data[i]) + '</option>';
};
};
_select.html(_html).prop('disabled', false).css({
'display': '',
'visibility': ''
});
// 初次加载设置默认值
if (typeof _select.attr('data-value') === 'string') {
_select.val(String(_select.attr('data-value'))).removeAttr('data-value');
if (_select[0].selectedIndex < 0) {
_select[0].options[0].selected = true;
};
};
if (_required || _select[0].selectedIndex > 0) {
_select.trigger('change');
};
};
// 改变选择时的处理
cxSelect.selectChange = function(name) {
var self = this;
if (typeof name !== 'string' || !name.length) {return};
var index;
name = name.replace(/\s+/g, ',');
name = ',' + name + ',';
// 获取当前 select 位置
for (var i = 0, l = self.selectArray.length; i < l; i++) {
if (name.indexOf(',' + self.settings.selects[i] + ',') > -1) {
index = i;
break;
};
};
if (typeof index === 'number' && index > -1) {
index += 1;
cxSelect.getOptionData.call(self, index);
};
};
$.cxSelect = function() {
return cxSelect.apply(this, arguments);
};
// 默认值
$.cxSelect.defaults = {
selects: [], // 下拉选框组
url: null, // 列表数据文件路径URL或数组数据
data: null, // 自定义数据
emptyStyle: null, // 无数据状态显示方式
required: false, // 是否为必选
firstTitle: '请选择', // 第一个选项的标题
firstValue: '', // 第一个选项的值
jsonSpace: '', // 数据命名空间
jsonName: 'n', // 数据标题字段名称
jsonValue: '', // 数据值字段名称
jsonSub: 's' // 子集数据字段名称
};
$.fn.cxSelect = function(settings, callback) {
this.each(function(i) {
$.cxSelect(this, settings, callback);
});
return this;
};
}));

File diff suppressed because one or more lines are too long

@ -1,21 +1,21 @@
/*!
* jQuery Validation Plugin v1.19.1
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2019 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
define( ["jquery"], factory );
} else if (typeof module === "object" && module.exports) {
module.exports = factory( require( "jquery" ) );
} else {
factory( jQuery );
}
}(function( $ ) {
/*!
* jQuery Validation Plugin v1.19.1
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2019 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
define( ["jquery"], factory );
} else if (typeof module === "object" && module.exports) {
module.exports = factory( require( "jquery" ) );
} else {
factory( jQuery );
}
}(function( $ ) {
$.extend( $.fn, {
// https://jqueryvalidation.org/validate/
@ -1610,7 +1610,7 @@ $.extend( $.validator, {
}
} );
// Ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
@ -1646,5 +1646,5 @@ if ( $.ajaxPrefilter ) {
return ajax.apply( this, arguments );
};
}
return $;
return $;
}));

@ -30,7 +30,8 @@ module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
// 开启调试
devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -195,7 +195,30 @@ function generateNewIndexJsp() {
let cdnHost = 'https://shixun.educoder.net'
cdnHost = 'https://ali-cdn.educoder.net'
cdnHost = ''
var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
var mainRegex = /<script type="text\/javascript" src="\/react\/build\/.\/static\/js\/main.([a-zA-Z0-9]{8,}).js"><\/script>/
var matchResult = data.match(mainRegex)
var code = `
<script>
(function() {
var _host = ''
/*
if (window.location.host == 'pre-newweb.educoder.net') {
_host = 'https://testali-cdn.educoder.net/react/build/'
} else if (window.location.host == 'www.educoder.net') {
_host = 'https://ali-newweb.educoder.net/react/build/'
}*/
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>');
})()
</script>
`
var jsMinAllRegex = /<script type="text\/javascript" src="\/js\/js_min_all.js"><\/script>/
// <script type="text/javascript" src="/js/js_min_all.js"></script>
var result = data
.replace(jsMinAllRegex, code)
// .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
// ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot
@ -204,10 +227,11 @@ function generateNewIndexJsp() {
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)
.replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`)
.replace(mainRegex, '')
// .replace('/react/build/./static/css/main', `${cdnHost}/react/build/./static/css/main`)
// .replace('/react/build/./static/js/main', `${cdnHost}/react/build/./static/js/main`)
.replace(/https:\/\/testeduplus2.educoder.net/g, '');
// .replace(/https:\/\/testeduplus2.educoder.net/g, '');
// .replace(/http:\/\/testbdweb.educoder.net/g, '');
// .replace('/css/css_min_all.css', '/react/build/css/css_min_all.css');

@ -55,6 +55,10 @@ html, body {
.markdown-body p {
white-space: pre-wrap;
}
/* https://www.educoder.net/courses/2346/group_homeworks/34405/question */
.renderAsHtml.markdown-body p {
white-space: inherit;
}
/* resize */
.editormd .CodeMirror {
border-right: none !important;

@ -1,4 +1,5 @@
import React, {Component} from 'react';
import './public-path';
import logo from './logo.svg';
import './App.css';
import {LocaleProvider} from 'antd'

@ -9,6 +9,7 @@ export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('')
// markdown to html
if (selector && oldContent && oldContent.startsWith('<p')) { // 普通html处理
window.$('#' + selector).addClass('renderAsHtml')
window.$('#' + selector).html(oldContent)
} else {
try {

@ -1,4 +1,5 @@
import React,{ Component } from "react";
import { ConditionToolTip } from 'educoder'
class AttachmentsList extends Component{
constructor(props){
@ -12,14 +13,18 @@ class AttachmentsList extends Component{
attachments.map((item,key)=>{
return(
<p key={key}>
<a className="color-grey">
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a>
{
item.is_pdf && item.is_pdf == true ?
<a href={item.url} className="mr12" length="58" target="_blank">{item.title}</a>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" target="_blank" style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
:
<a href={item.url} className="mr12" length="58">{item.title}</a>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
}
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p>

@ -129,12 +129,16 @@ class Fileslistitem extends Component{
.catch(function (error) {
console.log(error);
});
}
}
eventStop = (event) =>{
event.stopPropagation()
}
render(){
const { checkBox,
discussMessage,
discussMessage,index
} = this.props;
return(
@ -190,9 +194,9 @@ class Fileslistitem extends Component{
white-space:nowrap
}
`}</style>
<div className="clearfix ds pr contentSection">
<h6>
<span className="fl mr12 mt3">
<div className="clearfix ds pr contentSection" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.sourceitem${index} input`).click() }>
<h6 onClick={(event)=>this.eventStop(event)}>
<span className={`sourceitem${index} fl mr12 mt3`}>
{checkBox}
</span>
{
@ -283,16 +287,15 @@ class Fileslistitem extends Component{
</span>
</span>
{this.props.isAdmin?
<span className={"fr mrf2 mr10"}>
<span className={"fr mrf2 mr10"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
</span>:""}
{this.props.isStudent===true&&this.props.current_user.login===discussMessage.author.login?
<span className={"fr mrf2 mr10"}>
<span className={"fr mrf2 mr10"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"

@ -10,6 +10,8 @@ import Selectsetting from "../coursesPublic/SelectSetting";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import Fileslistitem from './Fileslistitem';
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import NoneData from "../coursesPublic/NoneData";
import _ from 'lodash'
import './style.css';
import '../css/members.css';
import moment from 'moment';
@ -474,7 +476,16 @@ class Fileslists extends Component{
}
onItemClick = (item) => {
const checkBoxValues = this.state.checkBoxValues.slice(0);
const index = checkBoxValues.indexOf(item.id);
if (index != -1) {
_.remove(checkBoxValues, (listItem)=> listItem === item.id)
} else {
checkBoxValues.push(item.id);
}
this.onCheckBoxChange(checkBoxValues)
}
PaginationTask=(page)=>{
let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state;
@ -787,7 +798,7 @@ class Fileslists extends Component{
showSearchInput={true}
></Titlesearchsection>
{this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
{this.props.isAdmin()? files===undefined?'' :files.length===0? "":<div className="mt20 edu-back-white padding20-30" style={{display:this.props.isAdmin()||this.props.isStudent()?"":"none"}}>
<div className="clearfix">
{this.props.isAdmin()? <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>:""}
<div className="studentList_operation_ul">
@ -897,7 +908,7 @@ class Fileslists extends Component{
{ files&&files.map((item, index) => {
return (
<div className="mt20 edu-back-white padding02010" key={index}>
<div className="mt20 edu-back-white padding02010" key={index} onClick={()=>this.onItemClick(item)}>
<div className="clearfix">
<div key={index}>
<Fileslistitem
@ -909,7 +920,8 @@ class Fileslists extends Component{
checkBox={this.props.isAdmin()?<Checkbox value={item.id} key={item.id}></Checkbox>:""}
Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}
updatafiledfun={()=>this.updatafiled()}
index={index}
></Fileslistitem>
</div>
</div>
@ -948,21 +960,23 @@ class Fileslists extends Component{
/>:""}
</div>
<div className="alltask edu-back-white"
style={
{
display: files===undefined?'none' :files.length===0? 'block' : 'none'
}
}
>
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
{
files===undefined?'' :files.length===0?<NoneData></NoneData>:""
}
</React.Fragment>
)
}
}
export default Fileslists;
export default Fileslists;
{/*<div className="alltask"*/}
{/*style={*/}
{/*{*/}
{/*display: files===undefined?'none' :files.length===0? 'block' : 'none'*/}
{/*}*/}
{/*}*/}
{/*>*/}
{/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
{/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
{/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
{/*</div>*/}

@ -376,10 +376,15 @@ class BoardsNew extends Component{
dropdownRender={menu => (
<div>
{menu}
<Divider style={{ margin: '4px 0' }} />
<div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}>
<Icon type="plus" /> 添加目录
</div>
{
isAdmin &&
<React.Fragment>
<Divider style={{ margin: '4px 0' }} />
<div style={{ padding: '8px', cursor: 'pointer' }} onMouseDown={() => this.refs['addDirModal'].open()}>
<Icon type="plus" /> 添加目录
</div>
</React.Fragment>
}
</div>
)}
>

@ -24,7 +24,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css'
import '../common/courseMessage.css'
import { Pagination, Tooltip } from 'antd'
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml } from 'educoder'
import { bytesToSize, ConditionToolTip, markdownToHTML, MarkdownToHtml , setImagesUrl } from 'educoder'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
@ -57,6 +57,7 @@ class TopicDetail extends Component {
pageCount: 1,
comments: [],
goldRewardDialogOpen: false,
author:undefined
}
}
componentDidMount() {
@ -85,7 +86,8 @@ class TopicDetail extends Component {
memo: Object.assign({}, {
...response.data.data,
replies_count: response.data.data.total_replies_count
}, {...this.state.memo})
}, {...this.state.memo}),
author:response.data.data.author
}, () => {
})
@ -514,7 +516,7 @@ class TopicDetail extends Component {
render() {
const { match, history } = this.props
const { recommend_shixun, current_user,author_info } = this.props;
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count } = this.state;
const { memo, comments, hasMoreComments, goldRewardDialogOpen, pageCount, total_count , author } = this.state;
const messageId = match.params.topicId
if (this.state.memoLoading || !current_user) {
return <div className="edu-back-white" id="forum_index_list"></div>
@ -599,51 +601,54 @@ class TopicDetail extends Component {
}
</div>
<div className="color-grey-9 clearfix">
<span className="fl" style={{marginTop: "2px"}}>{moment(memo.created_on).fromNow()} 发布</span>
<div className="fr">
</div>
</div>
<div className="color-grey-9 clearfix">
<span className="fl" style={{marginTop: '4px'}}>
{/* { current_user.admin && <Tooltip title={ "" }>
<span className="noteDetailNum rightline cdefault" style={{padding: '0 4px', cursor: 'pointer'}}>
<i className="iconfont icon-jiangli mr5" onClick={this.showRewardDialog}></i>
</span>
</Tooltip> } */}
<Tooltip title={"浏览数"}>
<span className={`noteDetailNum `} style={{paddingLeft: '0px'}}>
<i className="iconfont icon-liulanyan mr5"></i>
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
</span>
</Tooltip>
{ !!memo.total_replies_count &&
<Tooltip title={"回复数"}>
<a href="javascript:void(0)" className="noteDetailNum">
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
<span style={{ top: "2px", position: "relative" }}>{ memo.total_replies_count }</span>
</a>
</Tooltip>
}
{!!memo.praises_count &&
<Tooltip title={"点赞数"}>
<span className={`noteDetailNum `} style={{}}>
<i className="iconfont icon-dianzan-xian mr5"></i>
<span style={{ top: "2px", position: "relative" }}>{ memo.praises_count }</span>
<div className="df mt20">
<img src={setImagesUrl(`/images/${author && author.image_url}`)} className="radius mr10 mt2" width="40px" height="40px"/>
<div className="flex1">
<div className="color-grey-9 lineh-20">
<span class="color-grey-3 mr20 fl" style={{"fontWeight":"400"}}>{author && author.name}</span>
<span className="fl">{moment(memo.created_on).fromNow()} 发布</span>
</div>
<div className="color-grey-9 clearfix">
<span className="fl" style={{marginTop: '4px'}}>
{/* { current_user.admin && <Tooltip title={ "" }>
<span className="noteDetailNum rightline cdefault" style={{padding: '0 4px', cursor: 'pointer'}}>
<i className="iconfont icon-jiangli mr5" onClick={this.showRewardDialog}></i>
</span>
</Tooltip>
</Tooltip> } */}
<Tooltip title={"浏览数"}>
<span className={`noteDetailNum `} style={{paddingLeft: '0px'}}>
<i className="iconfont icon-liulanyan mr5"></i>
<span style={{ top: "1px", position: "relative" }}>{memo.visits || '1'}</span>
</span>
</Tooltip>
{ !!memo.total_replies_count &&
<Tooltip title={"回复数"}>
<a href="javascript:void(0)" className="noteDetailNum">
<i className="iconfont icon-huifu1 mr5" onClick={this.showCommentInput}></i>
<span style={{ top: "2px", position: "relative" }}>{ memo.total_replies_count }</span>
</a>
</Tooltip>
}
</span>
<div className="fr">
{/* || current_user.user_id === author_info.user_id */}
<a className={`task-hide fr return_btn color-grey-6 ${ current_user && (isAdmin
) ? '': 'no_mr'} `} onClick={() => this.props.toListPage(Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id})) } >
返回
</a>
</div>
{!!memo.total_praises_count &&
<Tooltip title={"点赞数"}>
<span className={`noteDetailNum `} style={{}}>
<i className="iconfont icon-dianzan-xian mr5"></i>
<span style={{ top: "2px", position: "relative" }}>{ memo.total_praises_count }</span>
</span>
</Tooltip>
}
</span>
<div className="fr">
{/* || current_user.user_id === author_info.user_id */}
<a className={`task-hide fr return_btn color-grey-6 ${ current_user && (isAdmin
) ? '': 'no_mr'} `} onClick={() => this.props.toListPage(Object.assign({}, this.props.match.params, {'coursesId': this.state.memo.course_id})) } >
返回
</a>
</div>
</div>
</div>
</div>
</div>

@ -363,9 +363,9 @@ class Boards extends Component{
<FilesListItem></FilesListItem> */}
{isAdmin && <div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>}
{messages&&messages.length == 0?"": isAdmin && <div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
{isAdmin&&<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul">
{ !!isAdmin &&
<React.Fragment>

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply'
import Example from './TestHooks'
import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments'
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
@ -88,6 +88,14 @@ class CommonWorkAppraise extends Component{
console.log(error)
})
}
componentDidUpdate(prevProps, prevState) {
if (this.props.match.params.studentWorkId != prevProps.match.params.studentWorkId) {
this.getWork();
this.getReviseAttachments()
this.commonWorkAppraiseReply && this.commonWorkAppraiseReply.fetchAllComments()
}
}
componentDidMount() {
this.getWork();
this.getReviseAttachments()
@ -156,12 +164,13 @@ class CommonWorkAppraise extends Component{
attachments, homework_id, project_info, work_members, is_evaluation,
description, update_user_name, update_time, commit_time, author_name,
revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login,
Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype
Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype, is_leader_work
} =this.state;
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let studentWorkId=this.props.match.params.studentWorkId;
const isAdmin = this.props.isAdmin()
return(
<WorkDetailPageHeader
{...this.props} {...this.state}
@ -251,12 +260,27 @@ class CommonWorkAppraise extends Component{
{is_evaluation != true && work_members && !!work_members.length && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}>
<div className={"color-grey-6 mb10"}>
其他组员
全部组员
</div>
<div className={"ml20"}>
{work_members.map((item, index) => {
return item.user_name + ' '
})}
<div className={"ml20 color-grey-6"}>
<div className="">
当前组员{author_name} {is_leader_work && <LeaderIcon small={true} ></LeaderIcon>}
</div>
<div>
其他组员
{work_members.map((item, index) => {
return <React.Fragment>
{isAdmin ?
<a className={`color-blue ${index == 0 ? '' : 'ml10'}`} href="javascript:void(0)"
onClick={() => this.props.toWorkDetailPage(this.props.match.params, null, item.work_id)}
>
{item.user_name}
</a> : <span className={`${index == 0 ? '' : 'ml10'}`} >{item.user_name}</span>}
{item.is_leader && <LeaderIcon small={true} ></LeaderIcon>}
</React.Fragment>
})}
</div>
</div>
</div>
}
@ -266,6 +290,7 @@ class CommonWorkAppraise extends Component{
{/* task_type={datalist&&datalist.task_type} */}
<CommonWorkAppraiseReply {...this.props} task_id={studentWorkId}
onReplySuccess={this.onReplySuccess} {...this.state}
wrappedComponentRef={(ref) => {this.commonWorkAppraiseReply = ref}}
></CommonWorkAppraiseReply>
</div>

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import PublishRightnow from './PublishRightnow'
import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
@ -97,7 +97,12 @@ function buildColumns(that, student_works, studentData) {
}} title={text && text.length > 5 ? text : ''}>
{/* <Tooltip placement="bottom" title={text}>
</Tooltip> */}
{text}
{record.is_leader ?
<div style={{ display: 'flex', 'flex-direction': 'column', 'align-items': 'center'}}>
<div >{text}</div>
<LeaderIcon></LeaderIcon>
</div>
: <React.Fragment>{text}</React.Fragment>}
</div>
),
}]

@ -0,0 +1,19 @@
import React,{Component} from "React";
export default function LeaderIcon(props = {}) {
let icon = null;
if (props.small) {
icon = <div className="font-8 blueFull Actionbtn" style={{
height: '14px',
'line-height': '14px',
width: '24px',
padding: 0,
'margin-top': '-2px',
'margin-left': '2px',
'vertical-align': 'middle', }}>组长</div>
} else {
icon = <div className="font-8 blueFull Actionbtn" style={{ height: '16px', 'line-height': '16px', width: '30px'}}>组长</div>
}
return icon
}

@ -85,8 +85,7 @@ class WorkDetailPageHeader extends Component{
background: #fff;
}
.workDetailPageHeader .summaryname {
line-height: 20px;
margin-top: 13px;
line-height:30px
}
`}</style>
<CBreadcrumb items={[
@ -99,18 +98,18 @@ class WorkDetailPageHeader extends Component{
// { name: childModuleName }
]}></CBreadcrumb>
<div style={{ width:'100%',height:'52px'}} >
<span className=" fl color-black summaryname" style={{height: 'auto'}}>
<div className="clearfix mt20 mb20" >
<span className=" fl color-black summaryname">
{homework_name}
{/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */}
</span>
<CoursesListType
typelist={homework_status}
typesylename={"mt12"}
typesylename={"mt3"}
/>
{category && <a className="color-grey-6 fr font-16 ml30 mt7 mr20" onClick={this.goback} style={{ marginRight: '26px'}}>返回</a>}
{category && <a className="color-grey-6 fr font-16 ml30 mr30 lineh-25" onClick={this.goback}>返回</a>}
{this.props.update_atta &&
<React.Fragment>

@ -143,7 +143,9 @@ class commonWork extends Component{
this.setState({
order:e.key==="all"?"":e.key,
page:1,
isSpin:true
isSpin:true,
checkBoxValues:[],
checkAll:false
})
let {search}=this.state;
this.getList(1,search,e.key==="all"?"":e.key);

@ -750,7 +750,7 @@ class Coursesleftnav extends Component{
{/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,2,"course_group",item.id)}>添加分班</div>:""}
{/*分班*/}
{item.type==="course_group"?<div onClick={e=>this.Navmodalnames(e,5,"editname",item.id,item.name)}>重命名</div>: <div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}></div>}
{item.type==="course_group"? <div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}>重命名</div>:""}
<div onClick={e=>this.edithidden(e,item.id)}>隐藏</div>
<div onClick={e=>this.editSetup(e,item.id)}>置顶</div>

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { getImageUrl , getUrl } from 'educoder';
class NoneData extends Component{
constructor(props) {
@ -9,7 +9,20 @@ class NoneData extends Component{
const { style } = this.props;
return(
<div className="edu-tab-con-box clearfix edu-txt-center" style={style}>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div>
)

@ -180,11 +180,13 @@ class PathModal extends Component{
}else{
// this.homeworkstart
//调用立即发布弹窗
// this.props.showNotification(response.data.message)
this.props.hidecouseShixunModal();
this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.props.updataleftNavfun()
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
// this.props.showNotification("选用成功")
// this.props.showNotification(response.data.message)
// this.props.homeworkupdatalists(Coursename,page,order);
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
}
// if(response.status===200) {

@ -1,209 +1,209 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin} from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
const Search = Input.Search
const pageCount = 15;
class SendToCourseModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
course_lists: [],
course_lists_after_filter: [],
searchValue: '',
hasMore: true,
loading: false,
page: 1
}
}
fetchCourseList = (arg_page) => {
const page = arg_page || this.state.page;
// search=''&
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
const searchValue = this.state.searchValue.trim()
if (searchValue) {
url += `&search=${searchValue}`
}
this.setState({ loading: true })
axios.get(url, {
})
.then((response) => {
if (!response.data.data || response.data.data.length == 0) {
this.setState({
course_lists: page == 1 ? [] : this.state.course_lists,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
course_lists_after_filter: response.data.data,
page,
loading: false,
hasMore: response.data.data.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
setTimeout(() => {
this.fetchCourseList()
}, 500)
}
setVisible = (visible) => {
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请先选择要发送至的课堂')
return;
}
if(this.props.url==="/files/bulk_send.json"){
axios.post("/files/bulk_send.json", {
course_id:this.props.match.params.coursesId,
ids: this.props.selectedMessageIds,
to_course_ids: this.state.checkBoxValues
})
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.gobackonSend(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}else{
const bid = this.props.match.params.boardId
const url = `/boards/${bid}/messages/bulk_send.json`
axios.post(url, {
ids: this.props.selectedMessageIds,
to_course_ids: this.state.checkBoxValues
})
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('发送成功')
}
})
.catch(function (error) {
console.log(error);
});
}
}
onOk = () => {
const { course_lists, checkBoxValues } = this.state
this.onSendOk()
// this.props.onOk && this.props.onOk(checkBoxValues)
// this.refs.modalWrapper.setVisible(false)
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
onSearchChange = (e) => {
this.setState({
searchValue: e.target.value
})
}
handleInfiniteOnLoad = () => {
console.log('loadmore...')
this.fetchCourseList(this.state.page + 1)
}
onSearch = () => {
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
// this.setState({ course_lists_after_filter })
this.fetchCourseList(1)
}
render(){
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
title={`发送${moduleName}`}
{...this.props }
onOk={this.onOk}
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}`}
</style>
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
<Search
className="mb14"
value={searchValue}
placeholder="请输入课堂名称进行搜索"
onChange={this.onSearchChange}
onSearch={this.onSearch}
></Search>
<div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ course_lists && course_lists.map( course => {
return (
<p className="clearfix mb7" key={course.id}>
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
{/* TODO */}
{/* {
!hasMore && <div>没有更多了</div>
} */}
</InfiniteScroll>
</div>
</div>
</ModalWrapper>
)
}
}
export default SendToCourseModal;
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin} from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
const Search = Input.Search
const pageCount = 15;
class SendToCourseModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
course_lists: [],
course_lists_after_filter: [],
searchValue: '',
hasMore: true,
loading: false,
page: 1
}
}
fetchCourseList = (arg_page) => {
const page = arg_page || this.state.page;
// search=''&
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
const searchValue = this.state.searchValue.trim()
if (searchValue) {
url += `&search=${searchValue}`
}
this.setState({ loading: true })
axios.get(url, {
})
.then((response) => {
if (!response.data.data || response.data.data.length == 0) {
this.setState({
course_lists: page == 1 ? [] : this.state.course_lists,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
course_lists_after_filter: response.data.data,
page,
loading: false,
hasMore: response.data.data.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
setTimeout(() => {
this.fetchCourseList()
}, 500)
}
setVisible = (visible) => {
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请先选择要发送至的课堂')
return;
}
if(this.props.url==="/files/bulk_send.json"){
axios.post("/files/bulk_send.json", {
course_id:this.props.match.params.coursesId,
ids: this.props.selectedMessageIds,
to_course_ids: this.state.checkBoxValues
})
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.gobackonSend(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}else{
const bid = this.props.match.params.boardId
const url = `/boards/${bid}/messages/bulk_send.json`
axios.post(url, {
ids: this.props.selectedMessageIds,
to_course_ids: this.state.checkBoxValues
})
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('发送成功')
}
})
.catch(function (error) {
console.log(error);
});
}
}
onOk = () => {
const { course_lists, checkBoxValues } = this.state
this.onSendOk()
// this.props.onOk && this.props.onOk(checkBoxValues)
// this.refs.modalWrapper.setVisible(false)
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
onSearchChange = (e) => {
this.setState({
searchValue: e.target.value
})
}
handleInfiniteOnLoad = () => {
console.log('loadmore...')
this.fetchCourseList(this.state.page + 1)
}
onSearch = () => {
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
// this.setState({ course_lists_after_filter })
this.fetchCourseList(1)
}
render(){
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
title={`发送${moduleName}`}
{...this.props }
onOk={this.onOk}
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}`}
</style>
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
<Search
className="mb14"
value={searchValue}
placeholder="请输入课堂名称进行搜索"
onChange={this.onSearchChange}
onSearch={this.onSearch}
></Search>
<div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ course_lists && course_lists.map( course => {
return (
<p className="clearfix mb7" key={course.id}>
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
{/* TODO */}
{/* {
!hasMore && <div>没有更多了</div>
} */}
</InfiniteScroll>
</div>
</div>
</ModalWrapper>
)
}
}
export default SendToCourseModal;

@ -1,80 +1,80 @@
.studentList_operation_ul{
color: #999;
font-size: 12px;
float: right;
margin-top: 2px;
}
.studentList_operation_ul li{
float: left;
padding:0px 20px;
position: relative;
cursor: pointer;
flex: 0 0 26px;
line-height: 26px;
}
.studentList_operation_ul li.li_line:after{
position: absolute;
content: '';
width: 1px;
height: 12px;
background-color: #EDEDED;
right: 0px;
top:6px;
}
.studentList_operation_ul li:last-child{
padding-right: 0px;
}
.studentList_operation_ul li:last-child:after{
width: 0px;
}
/* 基础的下拉列表、列如排序等 */
.drop_down_normal li{
padding: 0px 20px;
height: 34px;
line-height: 34px;
min-width: 96px;
color: #333;
font-size: 14px;
cursor: pointer;
width: 100%;
}
.stu_table table{
line-height: 1.2;
}
.stu_table .classesName{
display: block;
max-width: 428px;
}
.stu_table .ant-table-thead > tr > th{
padding:21px 16px;
border-bottom: none;
}
.stu_table .ant-table-tbody tr:last-child td{
border-bottom: none;
}
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
background-color: #fff;
}
.stu_head{
padding-bottom: 15px;
}
.ant-modal-body{
padding:30px 40px;
}
.color-dark-21{
color: #212121;
}
.tabletd {
background-color:#E6F7FF;
}
.yslminheigth{
min-height: 20px;
}
.yslminheigths{
min-height: 21px;
.studentList_operation_ul{
color: #999;
font-size: 12px;
float: right;
margin-top: 2px;
}
.studentList_operation_ul li{
float: left;
padding:0px 20px;
position: relative;
cursor: pointer;
flex: 0 0 26px;
line-height: 26px;
}
.studentList_operation_ul li.li_line:after{
position: absolute;
content: '';
width: 1px;
height: 12px;
background-color: #EDEDED;
right: 0px;
top:6px;
}
.studentList_operation_ul li:last-child{
padding-right: 0px;
}
.studentList_operation_ul li:last-child:after{
width: 0px;
}
/* 基础的下拉列表、列如排序等 */
.drop_down_normal li{
padding: 0px 20px;
height: 34px;
line-height: 34px;
min-width: 96px;
color: #333;
font-size: 14px;
cursor: pointer;
width: 100%;
}
.stu_table table{
line-height: 1.2;
}
.stu_table .classesName{
display: block;
max-width: 428px;
}
.stu_table .ant-table-thead > tr > th{
padding:21px 16px;
border-bottom: none;
}
.stu_table .ant-table-tbody tr:last-child td{
border-bottom: none;
}
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
background-color: #fff;
}
.stu_head{
padding-bottom: 15px;
}
.ant-modal-body{
padding:30px 40px;
}
.color-dark-21{
color: #212121;
}
.tabletd {
background-color:#E6F7FF;
}
.yslminheigth{
min-height: 20px;
}
.yslminheigths{
min-height: 21px;
}

@ -171,7 +171,20 @@ class Exercise extends Component{
checkAllValue: checkedValues.length == exercises.length
})
}
// 全选or反选
onItemClick = (item) => {
const checkBoxValues = this.state.checkBoxValues.slice(0);
const index = checkBoxValues.indexOf(item.id);
if (index != -1) {
_.remove(checkBoxValues, (listItem)=> listItem === item.id)
} else {
checkBoxValues.push(item.id)
}
this.onCheckBoxChange(checkBoxValues)
}
// 全选or反选
onCheckAll = (e) => {
this.setState({
checkAllValue: e.target.checked
@ -507,7 +520,7 @@ class Exercise extends Component{
</div>
</div>
<Spin size="large" spinning={this.state.isSpin}>
{this.props.isAdmin()?<div className="mt20 mb20 edu-back-white padding20-30">
{this.props.isAdmin()?exercises && exercises.length ===0?"":<div className="mt20 mb20 edu-back-white padding20-30">
<div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>
<div className="studentList_operation_ul">
@ -559,9 +572,9 @@ class Exercise extends Component{
{...this.props}
{...this.state}
item={item}
key={key}
checkBox={<Checkbox value={item.id} key={item.id}
// onClick={() => this.onItemClick(item)}
index={key}
onItemClick={this.onItemClick}
checkBox={<Checkbox value={item.id} key={item.id}
></Checkbox>}
></ExerciseListItem>
)

@ -52,17 +52,17 @@ class ExerciseListItem extends Component{
})
}
render(){
let{item,checkBox}=this.props;
let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin();
const IsStudent =this.props.isStudent();
// console.log(this.props.current_user.user_id)
return(
<div className="workList_Item" style={{padding:"30px"}}>
<div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }>
{
IsAdmin &&
<span className="fl mr12">
IsAdmin &&
<span className={`exerciseitem${index} fl mr12`}>
{checkBox}
</span>
}
@ -96,20 +96,20 @@ class ExerciseListItem extends Component{
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{
this.props.isAdmin()? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
title={item.exercise_name}
href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:""
to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
}
{
this.props.isStudent()?
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:""
<Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
}
{
this.props.isNotMember()? item.lock_status === 0 ?
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</a>:""
: <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
}
{
@ -165,8 +165,8 @@ class ExerciseListItem extends Component{
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}>
<a className="btn colorblue font-16" href={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</a>
<a className="btn colorblue ml20 font-16" href={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</a>
<Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
<Link className="btn colorblue ml20 font-16" to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link>
</div> }
</p>
@ -193,7 +193,7 @@ class ExerciseListItem extends Component{
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>
{item.current_status ===0&&item.exercise_status>1? <li> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>继续答题</Link></li>:
item.current_status ===1&&item.exercise_status>1? <li> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>查看答题</Link></li>:
item.current_status ===2&&item.exercise_status>1? <li> <a className="btn colorblue ml20 font-16" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""}
item.current_status ===2&&item.exercise_status>1? <li> <a className="btn colorblue ml20 font-16" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""}
</div>
}
</div>

@ -541,6 +541,18 @@ class ExerciseReviewAndAnswer extends Component{
.inputNumber30 .ant-input-number-input-wrap .ant-input-number-input{
height: 28px;
}
.setRadioStyle{
width:100%;
cursor:pointer;
}
.setRadioStyle span:last-child{
flex:1;
display:flex;
}
.setRadioStyle .ant-radio,.setRadioStyle .ant-checkbox{
height:16px;
margin-top:2px;
}
`}</style>
{/*<p style={{height:"60px"}}></p>*/}
<Modals

@ -44,19 +44,19 @@ class Multiple extends Component{
console.log(questionType);
return(
<div className="pl30 pr30 singleDisplay">
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} value={questionType.user_answer}>
<Checkbox.Group className="with100" disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} value={questionType.user_answer}>
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.`
return(
<p className="clearfix mb15 df">
<Checkbox className="fl lineh-15 df mr8 mt2" value={item.choice_id} key={item.choice_id}>{prefix}</Checkbox>
{/* <span class="fl lineh-20 mt1"></span> */}
{/* <span style={{display:"inline-block"}} className="markdown-body " dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}></span> */}
<MarkdownToHtml content={item.choice_text} selector={'multiple_' + (this.props.index + 1) + (key + 1)}
className="" style={{display:"inline-block"}}
></MarkdownToHtml>
<Checkbox className="lineh-15 df mr8 setRadioStyle" value={item.choice_id}>
<span className="fl mr3 lineh-20">{prefix}</span>
<MarkdownToHtml content={item.choice_text} selector={'multiple_' + (this.props.index + 1) + (key + 1)}
className="flex1" style={{display:"inline-block"}}
></MarkdownToHtml>
</Checkbox>
</p>
)
})

@ -40,18 +40,18 @@ class single extends Component{
let isJudge = questionType.question_type == 2
return(
<div className="pl30 pr30 singleDisplay">
<Radio.Group disabled={ user_exercise_status == 1 ? true : false } value={questionType.user_answer[0]} onChange={this.changeItem}>
<Radio.Group className="with100" disabled={ user_exercise_status == 1 ? true : false } value={questionType.user_answer[0]} onChange={this.changeItem}>
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = isJudge ? undefined : `${tagArray[key]}.`
return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40 df"}>
<Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio>
{/* <span className="fl lineh-20 mr3 "></span> */}
{/* <span style={{display:"inline-block", 'margin-top': '-1px'}} className="markdown-body fl " dangerouslySetInnerHTML={{__html: markdownToHTML1(item.choice_text)}}></span> */}
<MarkdownToHtml content={item.choice_text} selector={'single_' + (this.props.index + 1) + (key + 1)}
className="fl" style={{display:"inline-block", 'margin-top': '-1px'}}
></MarkdownToHtml>
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15" : "fl mr40"}>
<Radio className="df lineh-20 setRadioStyle" value={item.choice_id}>
<span className="fl mr3">{prefix}</span>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (this.props.index + 1) + (key + 1)}
className="flex1" style={{display:"inline-block", 'margin-top': '-1px'}}
></MarkdownToHtml>
</Radio>
</p>
)
})

@ -151,16 +151,12 @@ class GraduateTaskItem extends Component{
coursesId,
categoryid,
taskid,
index,
isAdmin
} = this.props;
// console.log(discussMessage)
return(
<div className="graduateTopicList boardsList">
<div className="graduateTopicList boardsList" style={{cursor : isAdmin ? "pointer" : "default" }} onClick={() => window.$(`.taskitem${index} input`).click() }>
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -193,8 +189,9 @@ class GraduateTaskItem extends Component{
margin-right: 15px;
}
`}</style>
{ checkBox }
<span className={`taskitem${index} fl`} style={{"height":"59px"}}>
{ checkBox }
</span>
{/*
style={{borderTop:data===undefined?"":data.course_identity<4?'1px solid #EBEBEB':'1px solid transparent'}}
*/}

@ -13,6 +13,7 @@ import Modals from '../../../modals/Modals';
import UseBank from "../../busyWork/UseBank";
import '../../css/members.css';
import '../style.css';
import NoneData from "../../coursesPublic/NoneData";
class GraduationTasks extends Component{
@ -350,8 +351,6 @@ class GraduationTasks extends Component{
checkBoxValues: checkedValues,
checkAllValue:type
})
}
@ -384,7 +383,9 @@ class GraduationTasks extends Component{
this.setState({
order: e.key,
isSpin:true
isSpin:true,
checkBoxValues:[],
checkAllValue:false
});
let newkey=e.key;
@ -696,7 +697,7 @@ class GraduationTasks extends Component{
<FilesListItem></FilesListItem> */}
{this.props.isAdmin()? <div className="mt20 edu-back-white padding20-30">
{this.props.isAdmin()?all_count===undefined?'' :all_count===0?"": <div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>
<div className="studentList_operation_ul">
@ -726,10 +727,10 @@ class GraduationTasks extends Component{
}
`}</style>
<Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ tasks.map((item, index) => {
{ tasks&&tasks.map((item, index) => {
// console.log(item)
return (
<div className="mt20 edu-back-white padding02010" key={index}>
<div className="mt20 edu-back-white pt10 pl30 pr30" key={index}>
<div className="clearfix">
<GraduateTaskItem
discussMessage={item}
@ -746,6 +747,7 @@ class GraduationTasks extends Component{
coursesId={this.props.match.params.coursesId}
categoryid={this.props.match.params.Id}
workid={item.work_id}
index={index}
></GraduateTaskItem>
</div>
</div>
@ -770,18 +772,11 @@ class GraduationTasks extends Component{
/>
</div>
}
<div className="alltask edu-back-white"
style={
{
display: all_count===undefined?'none' :all_count===0? 'block' : 'none'
}
}
>
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
{
all_count===undefined?'' :all_count===0? <NoneData></NoneData>:""
}
<div>
</div>
@ -790,4 +785,16 @@ class GraduationTasks extends Component{
)
}
}
export default GraduationTasks;
export default GraduationTasks;
{/*<div className="alltask"*/}
{/*style={*/}
{/*{*/}
{/*display: all_count===undefined?'none' :all_count===0? 'block' : 'none'*/}
{/*}*/}
{/*}*/}
{/*>*/}
{/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
{/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
{/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
{/*</div>*/}

@ -6,7 +6,7 @@ import '../style.css'
import axios from "axios";
import GraduateTopicReply from './GraduateTopicReply'
import { ConditionToolTip,MarkdownToHtml } from 'educoder'
import { ConditionToolTip , MarkdownToHtml , AttachmentList } from 'educoder'
const $=window.$;
const type={1: "设计",2: "论文", 3: "创作"}
@ -60,9 +60,10 @@ class GraduateTopicDetailTable extends Component{
{
topicInfo && topicInfo.attachment_list.length>0 &&
<p className="mt30">
{
{/* {
topicInfo.attachment_list.map((item,key)=>{
return(
<li className="clearfix mb8" key={key}>
<i className="iconfont icon-fujian color-green font-16 mr8 fl"></i>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
@ -72,7 +73,8 @@ class GraduateTopicDetailTable extends Component{
</li>
)
})
}
} */}
<AttachmentList {...this.props} {...this.state} attachments = {topicInfo.attachment_list}></AttachmentList>
</p>
}
</div>

@ -47,7 +47,7 @@ class GraduateTopicItem extends Component{
}
</style>
<div className="graduateTopicList boardsList mb20">
<div className="graduateTopicList boardsList mb20" style={{cursor : isAdmin ? "pointer" : "default" }} onClick={() => window.$(`.topicItem${index} input`).click() }>
<style>{`
.graduateTopicList .ant-checkbox-input {s
@ -58,7 +58,7 @@ class GraduateTopicItem extends Component{
padding: 17px 30px 20px!important;
}
`}</style>
{ isAdmin ? checkBox : ""}
{ isAdmin ? <span className={`topicItem${index} fl`} style={{"height":"64px"}}>{checkBox}</span> : ""}
<div className="clearfix ds pr flex1">
<style>{`
.maxwidth580{

@ -1,288 +1,288 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
import NoneData from '../../coursesPublic/NoneData'
import { ConditionToolTip, ThemeContext } from 'educoder'
import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
const Option = Select.Option;
const pageCount = 15;
class AddStudentModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
users: [],
hasMore: true,
loading: false,
courseGroup: '',
page: 1,
isSpin:false
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}`
this.setState({ loading: true })
axios.get(url)
.then((response) => {
if (!response.data.users || response.data.users.length == 0) {
this.setState({
users: page == 1 ? response.data.users : this.state.users,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
users: page == 1 ? response.data.users : this.state.users.concat(response.data.users),
page,
loading: false,
hasMore: response.data.users.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/all_course_groups.json`
axios.get(url, {
})
.then((response) => {
if (response.data.course_groups && response.data.course_groups.length) {
this.setState({
course_groups: response.data.course_groups,
courseGroup: response.data.course_groups[0].id
})
} else {
// showNotification('')
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.setState({school_name: this.props.user.user_school})
this.fetchMemberList()
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请从列表中先选择用户。')
return;
}
this.setState({
isSpin:true
})
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_students_by_search.json`
const params = {
"user_ids": this.state.checkBoxValues
}
const { courseGroup } = this.state
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
this.props.addStudentSuccess && this.props.addStudentSuccess(params)
this.setState({
isSpin:false
})
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
render(){
const { users, checkBoxValues, loading, hasMore, name, school_name
, courseGroup, course_groups,isSpin } = this.state
const { moduleName } = this.props
let theme = this.context;
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addStudentModal courseForm"
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: right;
margin-left: 12px;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.addTeacherModal label.task-hide {
width: 100%;
}
`}
</style>
<div className="df">
<span className="mr10">姓名:</span>
<Input allowClear placeholder="请输入真实姓名" value={name} onChange={(e) => {this.setState({name: e.target.value})}}
style={{ width: '221px'}}
></Input>
<span className="label" style={{ minWidth: '36px' }}>单位:</span>
{/* <Input allowClear placeholder="" value={school_name} onChange={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '200px'}}>
</Input> */}
<SchoolSelect
value={school_name}
onChange={(value) => {this.setState({school_name: value})}}
></SchoolSelect>
<a className="task-btn task-btn-orange" onClick={() => this.fetchMemberList(1)}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
>搜索</a>
</div>
{/* <Divider /> */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'学号'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{''}</label></span>
</p>
<Spin size="large" spinning={isSpin}>
{ loading || users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ users.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl with25">
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank" style={{"maxWidth":"208px;"}}>
{ candidate.name }
</a> : <span> </span> }
</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.student_id} condition={candidate.student_id && candidate.student_id.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.student_id || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl"
style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
</InfiniteScroll>
</div>
{course_groups && course_groups.length && <div className="df" style={{ marginTop: '12px' }} >
<span className="mr10" style={{ width: '148px' }}>所选学生分班至(选填):</span>
<Select style={{ width: 236 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
{ course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div>}
</div> : <NoneData></NoneData> }
</Spin>
</ModalWrapper>
)
}
}
AddStudentModal.contextType = ThemeContext;
export default AddStudentModal;
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
import NoneData from '../../coursesPublic/NoneData'
import { ConditionToolTip, ThemeContext } from 'educoder'
import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
const Option = Select.Option;
const pageCount = 15;
class AddStudentModal extends Component{
constructor(props){
super(props);
this.state={
checkBoxValues: [],
users: [],
hasMore: true,
loading: false,
courseGroup: '',
page: 1,
isSpin:false
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}`
this.setState({ loading: true })
axios.get(url)
.then((response) => {
if (!response.data.users || response.data.users.length == 0) {
this.setState({
users: page == 1 ? response.data.users : this.state.users,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
users: page == 1 ? response.data.users : this.state.users.concat(response.data.users),
page,
loading: false,
hasMore: response.data.users.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/all_course_groups.json`
axios.get(url, {
})
.then((response) => {
if (response.data.course_groups && response.data.course_groups.length) {
this.setState({
course_groups: response.data.course_groups,
courseGroup: response.data.course_groups[0].id
})
} else {
// showNotification('')
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.setState({school_name: this.props.user.user_school})
this.fetchMemberList()
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请从列表中先选择用户。')
return;
}
this.setState({
isSpin:true
})
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_students_by_search.json`
const params = {
"user_ids": this.state.checkBoxValues
}
const { courseGroup } = this.state
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
this.props.addStudentSuccess && this.props.addStudentSuccess(params)
this.setState({
isSpin:false
})
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
render(){
const { users, checkBoxValues, loading, hasMore, name, school_name
, courseGroup, course_groups,isSpin } = this.state
const { moduleName } = this.props
let theme = this.context;
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addStudentModal courseForm"
>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: right;
margin-left: 12px;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.addTeacherModal label.task-hide {
width: 100%;
}
`}
</style>
<div className="df">
<span className="mr10">姓名:</span>
<Input allowClear placeholder="请输入真实姓名" value={name} onChange={(e) => {this.setState({name: e.target.value})}}
style={{ width: '221px'}}
></Input>
<span className="label" style={{ minWidth: '36px' }}>单位:</span>
{/* <Input allowClear placeholder="" value={school_name} onChange={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '200px'}}>
</Input> */}
<SchoolSelect
value={school_name}
onChange={(value) => {this.setState({school_name: value})}}
></SchoolSelect>
<a className="task-btn task-btn-orange" onClick={() => this.fetchMemberList(1)}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
>搜索</a>
</div>
{/* <Divider /> */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'学号'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{''}</label></span>
</p>
<Spin size="large" spinning={isSpin}>
{ loading || users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ users.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl with25">
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank" style={{"maxWidth":"208px;"}}>
{ candidate.name }
</a> : <span> </span> }
</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.student_id} condition={candidate.student_id && candidate.student_id.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.student_id || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl"
style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
</InfiniteScroll>
</div>
{course_groups && course_groups.length && <div className="df" style={{ marginTop: '12px' }} >
<span className="mr10" style={{ width: '148px' }}>所选学生分班至(选填):</span>
<Select style={{ width: 236 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
{ course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div>}
</div> : <NoneData></NoneData> }
</Spin>
</ModalWrapper>
)
}
}
AddStudentModal.contextType = ThemeContext;
export default AddStudentModal;

@ -1,355 +1,355 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider, Icon } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
import { ConditionToolTip, ActionBtn } from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import AddGraduationGroupModal from './AddGraduationGroupModal'
import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
const Option = Select.Option;
const pageCount = 15;
let timeout, currentValue
class AddTeacherModal extends Component{
constructor(props){
super(props);
this.state={
school_names: [],
checkBoxValues: [],
candidates: [],
hasMore: true,
loading: false,
page: 1
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_teacher_candidate.json`
this.setState({ loading: true })
axios.post(url, {
page: page,
limit: pageCount,
school_name: school_name || '',
name: name || ''
})
.then((response) => {
if (!response.data.candidates || response.data.candidates.length == 0) {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
page,
loading: false,
hasMore: response.data.candidates.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
onAddGraduationGroupOk = () => {
this.fetchOptions()
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/add_teacher_popup.json`
axios.get(url, {
})
.then((response) => {
if (response.data.school_name) {
this.setState({
school_name: response.data.school_name
}, () => this.fetchMemberList())
} else {
this.fetchMemberList()
}
if (response.data.graduation_groups) {
this.setState({
graduation_groups: response.data.graduation_groups
})
}
if (response.data.course_groups) {
this.setState({
course_groups: response.data.course_groups
})
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_teacher.json`
if (this.state.checkBoxValues.length == 0) {
this.props.showNotification('请先在下面列表中选择要添加教师的成员')
return
}
const params = {
"user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
// "graduation_group_id": "2",
// "course_group_id": "820",
"role": this.props.isTeacher ? ROLE_TEACHER_NUM : ROLE_ASSISTANT_NUM
}
const { graduationGroup, courseGroup } = this.state
if (graduationGroup) {
params.graduation_group_id = graduationGroup
}
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
this.props.addTeacherSuccess && this.props.addTeacherSuccess(params)
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleGradationGroupChange = (value) => {
this.setState({
graduationGroup: value
})
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
onOrgNameChange = (value) => {
// console.log('school_name: ', value)
this.setState({ school_name: value })
}
hasGraduationModule = () => {
const { course_modules } = this.props;
const result = course_modules && course_modules.filter( item => {
return item.type == 'graduation'
})
return result && result.length > 0
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addTeacherModal courseForm"
>
<AddGraduationGroupModal ref="addGraduationGroupModal"
{...this.props} onOk={this.onAddGraduationGroupOk}
></AddGraduationGroupModal>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 210px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: left;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.addTeacherModal label.task-hide {
width: 100%;
}
`}
</style>
<div className="df">
<span className="firstLabel label" style={{ flex: '0 0 40px' }}>姓名:</span>
<Input allowClear placeholder="请输入真实姓名" value={name} onChange={(e) => {this.setState({name: e.target.value})}}
style={{ width: '200px', marginRight: '18px' }}>
</Input>
<span className="label" style={{ minWidth: '36px', flex: '0 0 40px' }}>单位:</span>
<SchoolSelect
value={school_name}
onChange={this.onOrgNameChange}
></SchoolSelect>
{/* <Select allowClear placeholder="" value={school_name}
style={{ width: '200px'}} showArrow={false}
filterOption={false} onSearch={this.onOrgNameSearch}
onChange={this.onOrgNameChange} notFoundContent={null}
showSearch defaultActiveFirstOption={false}
>
{ school_names && school_names.map((item, index) => {
return <Option value={item} key={index}>{item}</Option>
})}
</Select> */}
<a className="task-btn task-btn-orange" onClick={() => this.fetchMemberList(1)}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
>搜索</a>
</div>
{/* graduation_groups && !!graduation_groups.length */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'昵称'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{''}</label></span>
</p>
{ loading || candidates.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ candidates && candidates.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id}></Checkbox>
<span className="fl with25">
{/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}
>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
</InfiniteScroll>
</div>
</div> : <NoneData></NoneData> }
<div className="df">
{ this.hasGraduationModule() && <div className="df" style={{ marginTop: '24px' }} >
<span className="firstLabel label" style={{ flex: '0 0 96px' }}>添加至答辩组:</span>
<Select style={{ width: 218, marginRight: '18px' }} onChange={this.handleGradationGroupChange} value={graduationGroup}
dropdownRender={menu => (
<div>
{menu}
<Divider style={{ margin: '4px 0' }} />
{/* <ActionBtn
onMouseDown={() => { debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
>添加答辩组</ActionBtn> */}
<div style={{ padding: '8px', cursor: 'pointer' }}
onMouseDown={() => { debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
>
<Icon type="plus" /> 添加答辩组
</div>
</div>
)}
>
{ graduation_groups && graduation_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div>}
{ course_groups && !!course_groups.length && <div className="df">
<span className="firstLabel label">管理权限:</span>
<Select style={{ width: 218 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
{ course_groups && course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div> }
</div>
</ModalWrapper>
)
}
}
export default AddTeacherModal;
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Select, Divider, Icon } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import InfiniteScroll from 'react-infinite-scroller';
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
import { ConditionToolTip, ActionBtn } from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import AddGraduationGroupModal from './AddGraduationGroupModal'
import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
const Option = Select.Option;
const pageCount = 15;
let timeout, currentValue
class AddTeacherModal extends Component{
constructor(props){
super(props);
this.state={
school_names: [],
checkBoxValues: [],
candidates: [],
hasMore: true,
loading: false,
page: 1
}
}
fetchMemberList = (arg_page) => {
const courseId = this.props.match.params.coursesId
const page = arg_page || this.state.page;
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_teacher_candidate.json`
this.setState({ loading: true })
axios.post(url, {
page: page,
limit: pageCount,
school_name: school_name || '',
name: name || ''
})
.then((response) => {
if (!response.data.candidates || response.data.candidates.length == 0) {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates,
page,
loading: false,
hasMore: false,
})
} else {
this.setState({
candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
page,
loading: false,
hasMore: response.data.candidates.length == pageCount
})
}
})
.catch(function (error) {
console.log(error);
});
}
componentDidMount() {
}
onAddGraduationGroupOk = () => {
this.fetchOptions()
}
fetchOptions = () => {
// add_teacher_popup
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/add_teacher_popup.json`
axios.get(url, {
})
.then((response) => {
if (response.data.school_name) {
this.setState({
school_name: response.data.school_name
}, () => this.fetchMemberList())
} else {
this.fetchMemberList()
}
if (response.data.graduation_groups) {
this.setState({
graduation_groups: response.data.graduation_groups
})
}
if (response.data.course_groups) {
this.setState({
course_groups: response.data.course_groups
})
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.fetchOptions()
}
this.refs.modalWrapper.setVisible(visible)
if (visible == false) {
this.setState({
checkBoxValues: []
})
}
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_teacher.json`
if (this.state.checkBoxValues.length == 0) {
this.props.showNotification('请先在下面列表中选择要添加教师的成员')
return
}
const params = {
"user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
// "graduation_group_id": "2",
// "course_group_id": "820",
"role": this.props.isTeacher ? ROLE_TEACHER_NUM : ROLE_ASSISTANT_NUM
}
const { graduationGroup, courseGroup } = this.state
if (graduationGroup) {
params.graduation_group_id = graduationGroup
}
if (courseGroup) {
params.course_group_id = courseGroup
}
axios.post(url, params)
.then((response) => {
if (response.data.status == 0) {
this.setVisible(false)
this.props.showNotification('添加成功')
this.props.addTeacherSuccess && this.props.addTeacherSuccess(params)
}
})
.catch(function (error) {
console.log(error);
});
}
onOk = () => {
this.onSendOk()
}
onCheckBoxChange = (checkBoxValues) => {
this.setState({
checkBoxValues: checkBoxValues
})
}
handleInfiniteOnLoad = () => {
this.fetchMemberList(this.state.page + 1)
}
onSearch = () => {
this.fetchMemberList(1)
}
handleGradationGroupChange = (value) => {
this.setState({
graduationGroup: value
})
}
handleCourseGroupChange = (value) => {
this.setState({
courseGroup: value
})
}
onOrgNameChange = (value) => {
// console.log('school_name: ', value)
this.setState({ school_name: value })
}
hasGraduationModule = () => {
const { course_modules } = this.props;
const result = course_modules && course_modules.filter( item => {
return item.type == 'graduation'
})
return result && result.length > 0
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addTeacherModal courseForm"
>
<AddGraduationGroupModal ref="addGraduationGroupModal"
{...this.props} onOk={this.onAddGraduationGroupOk}
></AddGraduationGroupModal>
<style>
{`
.demo-loading-container {
position: absolute;
bottom: 210px;
width: 82%;
text-align: center;
}
.df {
display: flex;
align-items: baseline;
margin: 12px 0;
}
.firstLabel {
flex: 0 0 60px;
}
.df span.label {
margin-right: 8px;
text-align: left;
}
.df .ant-input-affix-wrapper {
width: 32%;
}
.addTeacherModal label.task-hide {
width: 100%;
}
`}
</style>
<div className="df">
<span className="firstLabel label" style={{ flex: '0 0 40px' }}>姓名:</span>
<Input allowClear placeholder="请输入真实姓名" value={name} onChange={(e) => {this.setState({name: e.target.value})}}
style={{ width: '200px', marginRight: '18px' }}>
</Input>
<span className="label" style={{ minWidth: '36px', flex: '0 0 40px' }}>单位:</span>
<SchoolSelect
value={school_name}
onChange={this.onOrgNameChange}
></SchoolSelect>
{/* <Select allowClear placeholder="" value={school_name}
style={{ width: '200px'}} showArrow={false}
filterOption={false} onSearch={this.onOrgNameSearch}
onChange={this.onOrgNameChange} notFoundContent={null}
showSearch defaultActiveFirstOption={false}
>
{ school_names && school_names.map((item, index) => {
return <Option value={item} key={index}>{item}</Option>
})}
</Select> */}
<a className="task-btn task-btn-orange" onClick={() => this.fetchMemberList(1)}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}}
>搜索</a>
</div>
{/* graduation_groups && !!graduation_groups.length */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'姓名'}</label></span>
<span className="fl with25"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'昵称'}</label></span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{'单位'}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{''}</label></span>
</p>
{ loading || candidates.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
pageStart={0}
loadMore={this.handleInfiniteOnLoad}
hasMore={!loading && hasMore}
useWindow={false}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{ candidates && candidates.map( candidate => {
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id}></Checkbox>
<span className="fl with25">
{/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}
>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</label>
</ConditionToolTip>
</span>
<span className="fl with25">
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.nickname || ' '}</label>
</ConditionToolTip>
</span>
<span className="fl with35"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.school_name}</label></span>
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</label></span>
</p>
)
}) }
</Checkbox.Group>
{loading && hasMore && (
<div className="demo-loading-container">
<Spin />
</div>
)}
</InfiniteScroll>
</div>
</div> : <NoneData></NoneData> }
<div className="df">
{ this.hasGraduationModule() && <div className="df" style={{ marginTop: '24px' }} >
<span className="firstLabel label" style={{ flex: '0 0 96px' }}>添加至答辩组:</span>
<Select style={{ width: 218, marginRight: '18px' }} onChange={this.handleGradationGroupChange} value={graduationGroup}
dropdownRender={menu => (
<div>
{menu}
<Divider style={{ margin: '4px 0' }} />
{/* <ActionBtn
onMouseDown={() => { debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
>添加答辩组</ActionBtn> */}
<div style={{ padding: '8px', cursor: 'pointer' }}
onMouseDown={() => { debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
>
<Icon type="plus" /> 添加答辩组
</div>
</div>
)}
>
{ graduation_groups && graduation_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div>}
{ course_groups && !!course_groups.length && <div className="df">
<span className="firstLabel label">管理权限:</span>
<Select style={{ width: 218 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
{ course_groups && course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}
</Select>
</div> }
</div>
</ModalWrapper>
)
}
}
export default AddTeacherModal;

@ -13,12 +13,15 @@ class CreateGroupByImportModal extends Component{
constructor(props){
super(props);
this.state={
errorTip:undefined
}
}
fetchMemberList = (arg_page) => {
}
componentDidMount() {
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/create_group_by_importing_file.json`
@ -109,7 +112,7 @@ class CreateGroupByImportModal extends Component{
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups , fileList , errorTip } = this.state
, graduationGroup, graduation_groups, courseGroup, course_groups , fileList } = this.state
const { moduleName } = this.props
const props = {
@ -129,18 +132,15 @@ class CreateGroupByImportModal extends Component{
onOk={this.onOk}
className="createGroupByImport"
>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<Icon type="inbox" />
</p>
<p className="ant-upload-text">点击或拖拽文件到这里上传</p>
<p className="ant-upload-hint">
单个文件最大150MB
</p>
</Dragger>
<p className="color-red lineh-25 edu-txt-left" style={{height:"25px"}}>
<span className={ errorTip ? "" : "none" }>{errorTip}</span>
</p>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<Icon type="inbox" />
</p>
<p className="ant-upload-text">点击或拖拽文件到这里上传</p>
<p className="ant-upload-hint">
单个文件最大150MB
</p>
</Dragger>
</ModalWrapper>
)
}

@ -288,6 +288,7 @@ class Poll extends Component{
})
let{type,StudentList_value}=this.state
this.InitList(type,StudentList_value,1);
this.props.updataleftNavfun();
}
}).catch((error)=>{
console.log(error);
@ -595,7 +596,8 @@ class Poll extends Component{
{...this.state}
courseType={course_types}
item={item}
key={key}
index={key}
onItemClick={this.onItemClick}
checkBox={<Checkbox value={item.id} key={item.id} onClick={() => this.onItemClick(item)}></Checkbox>}
></PollListItem>
)

@ -16,7 +16,7 @@ class PollListItem extends Component{
super(props);
}
render(){
let{item,checkBox,courseType}=this.props;
let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params;
const IsAdmin =this.props.isAdmin();
@ -28,10 +28,10 @@ class PollListItem extends Component{
let canNotLink = !isAdminOrStudent && item.lock_status == 0
return(
<div className="workList_Item polllisthover" style={{padding:"30px"}}>
<div className="workList_Item polllisthover" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.pollitem${index} input`).click() }>
{
IsAdmin &&
<span className="fl mr12">
<span className={`pollitem${index} fl mr12`}>
{checkBox}
</span>
}

@ -124,13 +124,19 @@ class ShixunhomeWorkItem extends Component{
})
}
editname = (name,id) => {
// 实训详情,阻止冒泡
stopPro = (event) => {
event.stopPropagation()
}
editname = (name,id,event) => {
this.setState({
ModalsRenametype:true,
NavmodalValue:name,
Navmodalname:"重命名",
url:`/homework_commons/${id}/alter_name.json`
})
event.stopPropagation()
}
cannerNavmoda=()=>{
this.setState({
@ -157,88 +163,74 @@ class ShixunhomeWorkItem extends Component{
const { checkBox,
discussMessage,
taskid,
taskid,index
} = this.props;
//
// allow_late: true //是否开启补交
// homework_id: 9250
// shixun_identifier: "25ykhpvl"
//
// console.log("this.props.isAdmin");
return(
<div className="graduateTopicList boardsList">
{this.state.ModalsRenametype===true?
<ModalsRename
{...this.props}
Navmodalnametype={this.state.ModalsRenametype}
NavmodalValue={this.state.NavmodalValue}
Navmodalname={this.state.Navmodalname}
Navname={"作业"}
url={this.state.url}
cannerNavmoda={()=>this.cannerNavmoda()}
/>
:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype}
loadtype={loadtype}
/>
{visible===true?<Associationmodel
modalname={modalname}
visible={visible}
Cancel={this.Cancel}
taskid={taskid}
funlist={this.props.funlist}
/>:""}
<Modal
keyboard={false}
title="提示"
visible={shixunsreplace}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div>
</Modal>
<Modal
keyboard={false}
title="提示"
visible={startshixunCombattype}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">本实训的开启时间{shixunsmessage} <br/>开启时间之前不能挑战
</p>
</div>
<div className="task-popup-submit clearfix">
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
<a className="task-btn task-btn-orange fr mr51" onClick={this.hidestartshixunCombattype}>知道啦</a>
</div>
{/*<p className="inviteTipbtn with100 fl">*/}
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
{/*</p>*/}
</Modal>
<React.Fragment>
{
this.state.ModalsRenametype===true?
<ModalsRename
{...this.props}
Navmodalnametype={this.state.ModalsRenametype}
NavmodalValue={this.state.NavmodalValue}
Navmodalname={this.state.Navmodalname}
Navname={"作业"}
url={this.state.url}
cannerNavmoda={()=>this.cannerNavmoda()}
/>
:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype}
loadtype={loadtype}
/>
{visible===true?<Associationmodel
modalname={modalname}
visible={visible}
Cancel={this.Cancel}
taskid={taskid}
funlist={this.props.funlist}
/>:""}
<Modal
keyboard={false}
title="提示"
visible={shixunsreplace}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div>
</Modal>
<Modal
keyboard={false}
title="提示"
visible={startshixunCombattype}
closable={false}
footer={null}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">本实训的开启时间{shixunsmessage} <br/>开启时间之前不能挑战
</p>
</div>
<div className="task-popup-submit clearfix">
{/*<a onClick={this.hidestartshixunCombattype} className="task-btn fl">取消</a>*/}
<a className="task-btn task-btn-orange fr mr51" onClick={this.hidestartshixunCombattype}>知道啦</a>
</div>
{/*<p className="inviteTipbtn with100 fl">*/}
{/*<a onClick={this.hidestartshixunCombattype}>知道了</a>*/}
{/*</p>*/}
</Modal>
<div className="graduateTopicList boardsList" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.shixunitem${index} input`).click() } >
<style>{`
.boardsList .ant-checkbox-wrapper{
margin-top: -35px;
@ -284,7 +276,11 @@ class ShixunhomeWorkItem extends Component{
`}</style>
{this.props.isAdmin?checkBox:""}
{this.props.isAdmin?
<span className={`shixunitem${index} fl`} style={{"height":"55px"}}>{checkBox}</span>
:
""
}
<div className="clearfix ds pr pt5 contentSection" >
<style>{`
@ -299,23 +295,23 @@ class ShixunhomeWorkItem extends Component{
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{
this.props.isAdmin?<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isStudent? <a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: <a href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
@ -383,9 +379,9 @@ class ShixunhomeWorkItem extends Component{
`
}
</style>
{this.props.isAdmin?<div className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a>
{this.props.isAdminOrCreator()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
{this.props.isAdmin?<div onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<Link className="btn colorblue font-16" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</div>:""}
@ -408,6 +404,7 @@ class ShixunhomeWorkItem extends Component{
</div>
</div>
</React.Fragment>
)
}
}

@ -587,6 +587,8 @@ class ShixunHomework extends Component{
let {Coursename,page}=this.state;
this.setState({
order: e.key,
checkBoxValues:[],
checkedtype:false,
isSpin:true
});
let newkey=e.key;
@ -655,6 +657,7 @@ class ShixunHomework extends Component{
}
savedelete=()=>{
let {Coursename,page,order,checkBoxValues,datas}=this.state;
let category_id=this.props.match.params.category_id;
@ -1019,8 +1022,8 @@ class ShixunHomework extends Component{
<div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
{/* <span className="font-18 fl color-dark-21">实训作业</span>*/}
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
@ -1035,7 +1038,7 @@ class ShixunHomework extends Component{
</p>
<div className="clearfix pl30 pr30">
<p style={{marginTop:'10px'}}>
<p style={{marginTop:'10px'}}>
<div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {datas&&datas.all_count}个实训作业</span>
<span style={{"marginLeft":"16px"}}>已发布{datas&&datas.published_count}</span>
@ -1062,7 +1065,9 @@ class ShixunHomework extends Component{
</div>
</div>
<Spin size="large" spinning={this.state.isSpin}>
{this.props.isAdmin()===true?<div className="mt20 edu-back-white padding20-30">
{this.props.isAdmin()===true?
datas===undefined?'' :datas.task_count===0?"":
<div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
<Checkbox className="fl" style={{marginTop:'0px'}}checked={checkedtype} onClick={this.funselect}>已选 {checkBoxValues&&checkBoxValues.length} </Checkbox>
@ -1152,7 +1157,7 @@ class ShixunHomework extends Component{
// console.log("++++++++++++++++++++++++++++++++++++++++++")
// console.log(JSON.stringify(this.props))
return (
<div className="mt20 edu-back-white padding02010" key={index}>
<div className="mt20 edu-back-white padding02010" key={index} >
<div className="clearfix">
<ShixunhomeWorkItem
{...this.props}
@ -1163,6 +1168,7 @@ class ShixunHomework extends Component{
isClassManagement={this.props.isClassManagement()}
checkBox={this.props.isAdmin()?<Checkbox value={item.homework_id} key={item.homework_id}></Checkbox>:""}
match={this.props.match}
index={index}
coursedata={this.props.coursedata}
coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)}
course_identity={datas.course_identity}
@ -1203,18 +1209,10 @@ class ShixunHomework extends Component{
</div>
{
datas===undefined?'' :datas.task_count===0? <NoneData></NoneData>:""
}
<div className="alltask "
style={
{
display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none'
}
}
>
<div className="edu-tab-con-box clearfix edu-txt-center"><img className="edu-nodata-img mb20"
src="/images/educoder/nodata.png" />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p></div>
</div>
</Spin>
</div>
@ -1223,3 +1221,14 @@ class ShixunHomework extends Component{
}
}
export default ShixunHomework;
// {/*<div className="alltask "*/}
// {/*style={*/}
// {/*{*/}
// {/*display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none'*/}
// {/*}*/}
// {/*}*/}
// {/*>*/}
// {/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
// {/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
// {/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
// {/*</div>*/}

@ -224,12 +224,15 @@ class MainContentContainer extends Component {
}
componentDidUpdate(prevProps, prevState, snapshot) {
const { game } = this.props
const { game, challenge } = this.props
if (game && prevProps.game
&& prevProps.game.identifier !== game.identifier) {
// 切换关卡时,停止轮训
this.oldGameIdentifier = prevProps.game.identifier;
this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
} else if (challenge && (challenge.pathIndex || prevProps.challenge.pathIndex) && challenge.pathIndex != prevProps.challenge.pathIndex) {
this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
}
}
@ -386,8 +389,8 @@ class MainContentContainer extends Component {
}
doFileUpdateRequestOnCodeMirrorBlur = () => {
var fileUpdatePromise = this.doFileUpdateRequest(true)
doFileUpdateRequestOnCodeMirrorBlur = (props) => {
var fileUpdatePromise = this.doFileUpdateRequest(true, undefined, props)
if (fileUpdatePromise) {
fileUpdatePromise.then((resData) => {
if (resData.status === -1) { // 保存文件出现异常
@ -496,7 +499,8 @@ class MainContentContainer extends Component {
}
// forTest true 是评测时触发的file_update
doFileUpdateRequest(checkIfCodeChanged, forTest) {
doFileUpdateRequest(checkIfCodeChanged, forTest, props) {
const _props = props || this.props;
const { codeStatus } = this.state;
if (!forTest && codeStatus !== UPDATED) { // 已修改状态才能保存
return;
@ -521,7 +525,7 @@ class MainContentContainer extends Component {
})
return null;
}
const { challenge, output_sets, onRunCodeTestFinish, myshixun } = this.props
const { challenge, output_sets, onRunCodeTestFinish, myshixun } = _props
// var url = `${locationPath}/file_update?path=${encodeURIComponent(challenge.path)}`
var url = `/myshixuns/${myshixun.identifier}/update_file.json`

@ -37,6 +37,8 @@ export function ImageLayerOfCommentHOC(options = {}) {
}
// jQuery._data( $('.newMain')[0], "events" )
componentDidMount() {
this.props.wrappedComponentRef && this.props.wrappedComponentRef(this.refs['wrappedComponentRef'])
// commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => {
$(options.parentSelector || ".commentsDelegateParent")
@ -60,7 +62,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
<React.Fragment>
<ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer>
<WrappedComponent {...this.props} >
<WrappedComponent {...this.props} ref="wrappedComponentRef">
</WrappedComponent>
</React.Fragment>
)

@ -14,7 +14,8 @@ class addCollaborators extends Component{
search:'',
partnerListid:[],
checkAll: false,
optionss:[]
optionss:[],
useristrue:false
}
}
addBox=()=>{
@ -70,6 +71,13 @@ class addCollaborators extends Component{
let {partnerListid} =this.state;
let id=this.props.match.params.pathId;
let url="/paths/"+id+"/add_subject_members.json"
if(partnerListid.length===0){
this.setState({
useristrue:true
})
return
}
axios.post(url,{
user_ids:partnerListid
}).then((response) => {
@ -87,9 +95,17 @@ class addCollaborators extends Component{
}
addCollaboratorsid=(id)=>{
this.setState({
partnerListid:id
})
if(id.length===0){
this.setState({
partnerListid:id,
})
}else{
this.setState({
partnerListid:id,
useristrue:false
})
}
}
onCheckAllChange = (e) => {
@ -145,7 +161,7 @@ class addCollaborators extends Component{
}
render(){
let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state;
let {addPartner,search,partnerList,optionss,checkAll,partnerListid,useristrue} = this.state;
return(
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?
@ -199,6 +215,7 @@ class addCollaborators extends Component{
}
</CheckboxGroup>
</ul>
{useristrue===true?<span className={"color-red"}>请先选择用户</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center">
<a onClick={this.hideAddBox} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={this.SaveAddBox} id="submit_send_shixun">确定</a>

@ -45,7 +45,8 @@ class Collaborators extends Component {
collaboratorListsumtype:true,
user_name:undefined,
school_name:undefined,
spinnings:false
spinnings:false,
useristrue:false
}
}
componentDidMount() {
@ -217,10 +218,20 @@ class Collaborators extends Component {
} else {
alltype = false
}
this.setState({
Searchadmin: newlist,
allChangechecked: alltype
})
if(newlist.length===0){
this.setState({
Searchadmin: newlist,
allChangechecked: alltype,
})
}else{
this.setState({
Searchadmin: newlist,
allChangechecked: alltype,
useristrue:false
})
}
}
allChange = (e) => {
@ -260,6 +271,13 @@ class Collaborators extends Component {
}
}
}
if(user_ids.length===0){
this.setState({
useristrue:true
})
return
}
let url = "/shixuns/" + id + "/shixun_members_added.json";
axios.post(url, {
user_ids: user_ids
@ -405,7 +423,8 @@ class Collaborators extends Component {
collaboratorListsum,
collaboratorListsumtype,
user_name,
school_name
school_name,
useristrue
} = this.state;
let {loadingContent} = this.props;
const radioStyle = {
@ -547,7 +566,7 @@ class Collaborators extends Component {
</div>
{useristrue===true?<span className={"color-red"}>请先选择用户</span>:""}
<div className="clearfix edu-txt-center mt20">
<a className="pop_close task-btn mb10 mr40 colorFFF"
onClick={() => this.CollaboratorsshowModal("cooperation")}>取消</a>

@ -1,45 +1,45 @@
.ml350 {
margin-left: 40%;
}
.ml32 {
margin-left: 32%;
}
.square-Item{
/*min-height: 324px;*/
}
.square-img{
min-height: 210px;
}
.task-hide{
margin-bottom: 0em;
}
.backFAFAFA{
background:#FAFAFA;
}
.demo {
width: 500px;
background-color: #0dcecb;
text-align: center;
padding:50px;
}
.next-loading {
margin-bottom: 5px;
width:100%;
}
.next-rating-overlay .next-icon{
color: #FFA800!important;
}
.custom-pagination {
display: inline-block;
margin-left: 10px;
}
.ml425{
margin-left:42.5%;
margin-top:20px;
.ml350 {
margin-left: 40%;
}
.ml32 {
margin-left: 32%;
}
.square-Item{
/*min-height: 324px;*/
}
.square-img{
min-height: 210px;
}
.task-hide{
margin-bottom: 0em;
}
.backFAFAFA{
background:#FAFAFA;
}
.demo {
width: 500px;
background-color: #0dcecb;
text-align: center;
padding:50px;
}
.next-loading {
margin-bottom: 5px;
width:100%;
}
.next-rating-overlay .next-icon{
color: #FFA800!important;
}
.custom-pagination {
display: inline-block;
margin-left: 10px;
}
.ml425{
margin-left:42.5%;
margin-top:20px;
}

@ -1,249 +1,249 @@
import React, { Component } from 'react';
import {Pagination,Spin,Checkbox,Modal} from 'antd';
import moment from 'moment';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import Modals from '../../modals/Modals'
const dateFormat ="YYYY-MM-DD HH:mm"
class InfosBank extends Component{
constructor(props){
super(props);
this.state={
category:"common",
type:"publicly",
page:1,
per_page:16,
sort_by:"updated_at",
CoursesId:undefined,
totalCount:undefined,
data:undefined,
isSpin:false,
dialogOpen:false,
modalsTopval:undefined,
modalsBottomval:undefined,
modalSave:undefined
}
}
componentDidMount=()=>{
this.setState({
isSpin:true
})
let{category,type,page,sort_by,CoursesId}=this.state;
this.getCourses(category,type,page,sort_by,CoursesId);
}
getCourses=(category,type,page,sort_by,CoursesId)=>{
let url=`/users/${this.props.match.params.username}/question_banks.json`;
axios.get((url),{params:{
category,
type,
page,
sort_by,
per_page:category && page ==1?17:16,
course_list_id:CoursesId
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//切换种类
changeCategory=(cate)=>{
this.setState({
category:cate,
page:1,
isSpin:true
})
let{type,sort_by,CoursesId}=this.state;
this.getCourses(cate,type,1,sort_by,CoursesId);
}
//切换状态
changeType=(type)=>{
this.setState({
type:type,
page:1,
isSpin:true
})
let{category,sort_by,CoursesId}=this.state;
this.getCourses(category,type,1,sort_by,CoursesId);
}
//切换页数
changePage=(page)=>{
this.setState({
page,
isSpin:true
})
let{category,type,sort_by,CoursesId}=this.state;
this.getCourses(category,type,page,sort_by,CoursesId);
}
// 进入课堂
turnToCourses=(url)=>{
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
this.setState({
sort_by:sort,
isSpin:true
})
let{category,type,page,CoursesId}=this.state;
this.getCourses(category,type,page,sort,CoursesId);
}
changeCourseListId =(CoursesId)=>{
this.setState({
CoursesId,
isSpin:true
})
let{category,type,sort,page}=this.state;
this.getCourses(category,type,page,sort,CoursesId);
}
//设为公开/删除
setPublic=(index)=>{
this.setState({
dialogOpen:true,
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
modalsBottomval:index==1?"公开后不能重设为私有":"",
modalSave:()=>this.sureOperation(index)
})
}
// 确定--设为公开/删除
sureOperation=()=>{
}
//弹框隐藏
handleDialogClose=()=>{
this.setState({
dialogOpen:false
})
}
render(){
let{
category,
type,
page,
data,
totalCount,
sort_by,
isSpin,
CoursesId,
dialogOpen,
modalsTopval,
modalsBottomval,modalSave
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
return(
<div className="educontent">
<Modals
modalsType={dialogOpen}
modalsTopval={modalsTopval}
modalsBottomval={modalsBottomval}
modalCancel={this.handleDialogClose}
modalSave={modalSave}
></Modals>
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
</div>
<div className="edu-back-white padding20-30 bor-top-greyE">
<ul className="clearfix secondNav">
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
</ul>
<div className="edu-txt-left mt10 bankTag">
<ul className="inline" id="sourceTag">
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
<a href="javascript:void(0)">全部</a>
</li>
{
data && data.course_list && data.course_list.map((item,key)=>{
return(
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
<a href="javascript:void(0)">{item.name}</a>
</li>
)
})
}
</ul>
</div>
</div>
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
</ul>
</li>
</div>
</p>
<div className="dataBank_list edu-back-white educontent">
{
!data || data.question_banks.length==0 && <NoneData></NoneData>
}
{
data && data.question_banks && data.question_banks.map((item,key)=>{
return(
<div className="dataBank_Item clearfix" key={key}>
<div className="fl dataItemLeft">
<Checkbox value={item.id} key={item.id}></Checkbox>
</div>
<div className="fr dataItemRight bank_item">
<p className="mb10 clearfix">
<span className="dataTitle fl mr80">{item.name}</span>
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
{
item.is_public ==false ?
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
}
</p>
<p className="itembottom clearfix">
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
<span className="bank_list_Tag">{item.course_list_name}</span>
</p>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div>
}
</Spin>
</div>
)
}
}
import React, { Component } from 'react';
import {Pagination,Spin,Checkbox,Modal} from 'antd';
import moment from 'moment';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import Modals from '../../modals/Modals'
const dateFormat ="YYYY-MM-DD HH:mm"
class InfosBank extends Component{
constructor(props){
super(props);
this.state={
category:"common",
type:"publicly",
page:1,
per_page:16,
sort_by:"updated_at",
CoursesId:undefined,
totalCount:undefined,
data:undefined,
isSpin:false,
dialogOpen:false,
modalsTopval:undefined,
modalsBottomval:undefined,
modalSave:undefined
}
}
componentDidMount=()=>{
this.setState({
isSpin:true
})
let{category,type,page,sort_by,CoursesId}=this.state;
this.getCourses(category,type,page,sort_by,CoursesId);
}
getCourses=(category,type,page,sort_by,CoursesId)=>{
let url=`/users/${this.props.match.params.username}/question_banks.json`;
axios.get((url),{params:{
category,
type,
page,
sort_by,
per_page:category && page ==1?17:16,
course_list_id:CoursesId
}}).then((result)=>{
if(result){
this.setState({
totalCount:result.data.count,
data:result.data,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
//切换种类
changeCategory=(cate)=>{
this.setState({
category:cate,
page:1,
isSpin:true
})
let{type,sort_by,CoursesId}=this.state;
this.getCourses(cate,type,1,sort_by,CoursesId);
}
//切换状态
changeType=(type)=>{
this.setState({
type:type,
page:1,
isSpin:true
})
let{category,sort_by,CoursesId}=this.state;
this.getCourses(category,type,1,sort_by,CoursesId);
}
//切换页数
changePage=(page)=>{
this.setState({
page,
isSpin:true
})
let{category,type,sort_by,CoursesId}=this.state;
this.getCourses(category,type,page,sort_by,CoursesId);
}
// 进入课堂
turnToCourses=(url)=>{
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
this.setState({
sort_by:sort,
isSpin:true
})
let{category,type,page,CoursesId}=this.state;
this.getCourses(category,type,page,sort,CoursesId);
}
changeCourseListId =(CoursesId)=>{
this.setState({
CoursesId,
isSpin:true
})
let{category,type,sort,page}=this.state;
this.getCourses(category,type,page,sort,CoursesId);
}
//设为公开/删除
setPublic=(index)=>{
this.setState({
dialogOpen:true,
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
modalsBottomval:index==1?"公开后不能重设为私有":"",
modalSave:()=>this.sureOperation(index)
})
}
// 确定--设为公开/删除
sureOperation=()=>{
}
//弹框隐藏
handleDialogClose=()=>{
this.setState({
dialogOpen:false
})
}
render(){
let{
category,
type,
page,
data,
totalCount,
sort_by,
isSpin,
CoursesId,
dialogOpen,
modalsTopval,
modalsBottomval,modalSave
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
return(
<div className="educontent">
<Modals
modalsType={dialogOpen}
modalsTopval={modalsTopval}
modalsBottomval={modalsBottomval}
modalCancel={this.handleDialogClose}
modalSave={modalSave}
></Modals>
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
</div>
<div className="edu-back-white padding20-30 bor-top-greyE">
<ul className="clearfix secondNav">
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
</ul>
<div className="edu-txt-left mt10 bankTag">
<ul className="inline" id="sourceTag">
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
<a href="javascript:void(0)">全部</a>
</li>
{
data && data.course_list && data.course_list.map((item,key)=>{
return(
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
<a href="javascript:void(0)">{item.name}</a>
</li>
)
})
}
</ul>
</div>
</div>
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
<ul className="drop_down_normal">
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
</ul>
</li>
</div>
</p>
<div className="dataBank_list edu-back-white educontent">
{
!data || data.question_banks.length==0 && <NoneData></NoneData>
}
{
data && data.question_banks && data.question_banks.map((item,key)=>{
return(
<div className="dataBank_Item clearfix" key={key}>
<div className="fl dataItemLeft">
<Checkbox value={item.id} key={item.id}></Checkbox>
</div>
<div className="fr dataItemRight bank_item">
<p className="mb10 clearfix">
<span className="dataTitle fl mr80">{item.name}</span>
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
{
item.is_public ==false ?
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
}
</p>
<p className="itembottom clearfix">
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
<span className="bank_list_Tag">{item.course_list_name}</span>
</p>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div>
}
</Spin>
</div>
)
}
}
export default InfosBank;

@ -1,115 +1,122 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import "../../courses/css/members.css"
import "../../courses/css/Courses.css"
import banner from '../../../images/account/infobanner.png'
class InfosBanner extends Component{
constructor(props){
super(props);
}
render(){
let {
data ,
id,
login,
moduleName,
current_user,
}=this.props;
let is_current=this.props.is_current;
let {username}= this.props.match.params;
let {pathname}=this.props.location;
moduleName=pathname.split("/")[3];
return(
<div className="bannerPanel mb60">
<div className="educontent">
<div className="clearfix color-white mb25">
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
<div className="fl">
<p className="clearfix mt20">
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
{
data && is_current == false && data.identity =="学生" ? "" :
<span className="userpost"><label>{data && data.identity}</label></span>
}
</p>
<p className="mt15">
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
</Tooltip>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
</Tooltip>
</p>
</div>
<div className="fr">
<div class="fl headtab mt20">
<span>{is_current ? "我":"TA"}的经验值</span>
<a style={{"cursor":"default"}}>{data && data.experience}</a>
</div>
<div class="fl headtab mt20 pr leftTransform pl20">
<span>{is_current ? "我":"TA"}的金币</span>
<a style={{"cursor":"default"}}>{data && data.grade}</a>
</div>
{
is_current ?
<span className="fl mt35 ml60">
{
data && data.attendance_signed ?
<span className="user_default_btn user_grey_btn font-18">已签到</span>
:
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
}
</span>
:
<span className="fl mt35 ml60">
<a href={`/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a>
</span>
}
</div>
</div>
<div className="userNav">
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>翻转课堂</Link>
</li>
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>实训项目</Link>
</li>
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'paths'})}
to={`/users/${username}/paths`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>开发项目</Link>
</li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频</Link>
</li>}
</div>
</div>
</div>
)
}
}
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import "../../courses/css/members.css"
import "../../courses/css/Courses.css"
import { LinkAfterLogin } from 'educoder'
class InfosBanner extends Component{
constructor(props){
super(props);
}
render(){
let {
data ,
id,
login,
moduleName,
current_user,
}=this.props;
let is_current=this.props.is_current;
let {username}= this.props.match.params;
let {pathname}=this.props.location;
moduleName=pathname.split("/")[3];
return(
<div className="bannerPanel mb60">
<div className="educontent">
<div className="clearfix color-white mb25">
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
<div className="fl">
<p className="clearfix mt20">
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
{
data && is_current == false && data.identity =="学生" ? "" :
<span className="userpost"><label>{data && data.identity}</label></span>
}
</p>
<p className="mt15">
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
</Tooltip>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
</Tooltip>
</p>
</div>
<div className="fr">
<div class="fl headtab mt20">
<span>{is_current ? "我":"TA"}的经验值</span>
<a style={{"cursor":"default"}}>{data && data.experience}</a>
</div>
<div class="fl headtab mt20 pr leftTransform pl20">
<span>{is_current ? "我":"TA"}的金币</span>
<a style={{"cursor":"default"}}>{data && data.grade}</a>
</div>
{
is_current ?
<span className="fl mt35 ml60">
{
data && data.attendance_signed ?
<span className="user_default_btn user_grey_btn font-18">已签到</span>
:
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
}
</span>
:
<span className="fl mt35 ml60">
<LinkAfterLogin
{...this.props}
{...this.state}
className="user_default_btn user_yellow_btn fl font-18"
to={`/messages/${login}/message_detail?target_ids=${id}`}
>
私信
</LinkAfterLogin>
</span>
}
</div>
</div>
<div className="userNav">
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>翻转课堂</Link>
</li>
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>开发社区</Link>
</li>
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'paths'})}
to={`/users/${username}/paths`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>项目</Link>
</li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频</Link>
</li>}
</div>
</div>
</div>
)
}
}
export default InfosBanner;

@ -130,7 +130,7 @@ class InfosCourse extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || data.courses.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
(!data || (data && data.courses.length==0)) && category && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item,key)=>{

@ -152,7 +152,7 @@ class InfosPath extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
}
{
(!data || data.subjects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
(!data || (data && data.subjects.length==0)) && category && <NoneData></NoneData>
}
{
data && data.subjects && data.subjects.map((item,key)=>{

@ -125,7 +125,7 @@ class InfosProject extends Component{
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4"></Create>:""
}
{
(!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
(!data || (data && data.projects.length==0)) && category && <NoneData></NoneData>
}
{
data && data.projects && data.projects.map((item,key)=>{

@ -1,14 +1,11 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { Pagination , Spin } from 'antd';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import { setImagesUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
@ -115,7 +112,7 @@ class InfosShixun extends Component{
totalCount,
isSpin
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
return(
<div className="educontent">
@ -157,20 +154,18 @@ class InfosShixun extends Component{
</div>
<div className="square-list clearfix">
{
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{
(!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && <NoneData></NoneData>
(!data || (data && data.shixuns.length==0)) && category && <NoneData></NoneData>
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/>*/}
</div>
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span><img className="fl" src={setImagesUrl("images/educoder/tag2.png")}/></div>
}
<a href="javascript:void(0)" className="square-img">
<img src={setImagesUrl(`${item.image_url}`)}/>

@ -1,190 +1,190 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import "../../courses/css/members.css"
import "../../courses/css/Courses.css"
class banner_out extends Component{
constructor(props){
super(props);
}
render(){
let {
data ,
is_current,
is_edit,
sign,
type,
followed,
id,
login,
moduleName,
next_gold
}=this.props;
let {username}= this.props.match.params;
return(
<div className="user-main-half">
<div className="user-headImg"></div>
<div className="user-headCon">
<div className="pr" style={{"min-height": "465px"}}>
<div className="educontent pt80 clearfix edu-txt-center">
<div className="inline">
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的经验值</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
>{data && data.experience}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的金币</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
id="user_code">{data && data.grade}</a>
</div>
<div className="headphoto mt14">
<img alt="头像" id="user_avatar_show" nhname="avatar_image" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/>
</div>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的粉丝</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
id="user_h_fan_count">{data && data.fan_count}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的关注</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
>{data && data.follow_count}</a>
</div>
<span className="clearfix"></span>
<span className="myName">{data && data.name}</span>
</div>
</div>
<div className="educontent mt10 clearfix edu-txt-center">
<div className="inline">
{
data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span>
}
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}>
<i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}>
<i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
{/* <!--学院管理员身份--> */}
{
data && data.college_identifier &&
<a
// href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title="学院管理员">
<i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i>
</Tooltip>
</a>
}
</div>
</div>
<div className="mt15 educontent clearfix edu-txt-center">
<p className="mb20" style={{"height": "28px"}}>
{
is_edit && is_current ?
<input type="text" id="mysign" class="mysign-input" placeholder="请输入您的个性签名" style={{height:"20px"}} value={sign} onInput={this.inputSign} onBlur={this.savemysign}/>
:
is_current ?
<a className="mysign-span" onClick={this.editmysign} style={{"display": "block"}}>{sign || "这家伙很懒,什么都没留下~"}</a>
:
<span className="mysign-span" style={{"display": "block","cursor":"default"}}>{sign || "这家伙很懒,什么都没留下~"}</span>
}
</p>
{
is_current ?
<div className="inline">
{
data && data.attendance_signed ?
<React.Fragment>
<span className="user_default_btn user_grey_btn mb5">已签到</span>
<p id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{next_gold}</font>&nbsp;</p>
</React.Fragment>
:
<a herf="javascript:void(0);" onClick={this.props.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
// <a herf="javascript:void(0);" onClick={this.trialapplications} id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
}
</div>
:
<div className="inline">
<a href="javascript:void(0);" onClick={this.props.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
</div>
}
</div>
<div className="edu-txt-center navInfo">
<div className="inline">
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>课堂</Link>
</li>
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>实训</Link>
</li>
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'paths'})}
to={`/users/${username}/paths`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>开发项目</Link>
</li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
</div>
</div>
</div>
</div>
</div>
)
}
}
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import {getImageUrl} from 'educoder';
import "./usersInfo.css"
import "../../courses/css/members.css"
import "../../courses/css/Courses.css"
class banner_out extends Component{
constructor(props){
super(props);
}
render(){
let {
data ,
is_current,
is_edit,
sign,
type,
followed,
id,
login,
moduleName,
next_gold
}=this.props;
let {username}= this.props.match.params;
return(
<div className="user-main-half">
<div className="user-headImg"></div>
<div className="user-headCon">
<div className="pr" style={{"min-height": "465px"}}>
<div className="educontent pt80 clearfix edu-txt-center">
<div className="inline">
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的经验值</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
>{data && data.experience}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的金币</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
id="user_code">{data && data.grade}</a>
</div>
<div className="headphoto mt14">
<img alt="头像" id="user_avatar_show" nhname="avatar_image" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/>
</div>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的粉丝</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
id="user_h_fan_count">{data && data.fan_count}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的关注</span>
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
>{data && data.follow_count}</a>
</div>
<span className="clearfix"></span>
<span className="myName">{data && data.name}</span>
</div>
</div>
<div className="educontent mt10 clearfix edu-txt-center">
<div className="inline">
{
data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span>
}
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}>
<i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
<a
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"}
// target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}>
<i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i>
</Tooltip>
</a>
{/* <!--学院管理员身份--> */}
{
data && data.college_identifier &&
<a
// href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank"
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
<Tooltip placement='bottom' title="学院管理员">
<i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i>
</Tooltip>
</a>
}
</div>
</div>
<div className="mt15 educontent clearfix edu-txt-center">
<p className="mb20" style={{"height": "28px"}}>
{
is_edit && is_current ?
<input type="text" id="mysign" class="mysign-input" placeholder="请输入您的个性签名" style={{height:"20px"}} value={sign} onInput={this.inputSign} onBlur={this.savemysign}/>
:
is_current ?
<a className="mysign-span" onClick={this.editmysign} style={{"display": "block"}}>{sign || "这家伙很懒,什么都没留下~"}</a>
:
<span className="mysign-span" style={{"display": "block","cursor":"default"}}>{sign || "这家伙很懒,什么都没留下~"}</span>
}
</p>
{
is_current ?
<div className="inline">
{
data && data.attendance_signed ?
<React.Fragment>
<span className="user_default_btn user_grey_btn mb5">已签到</span>
<p id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{next_gold}</font>&nbsp;</p>
</React.Fragment>
:
<a herf="javascript:void(0);" onClick={this.props.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
// <a herf="javascript:void(0);" onClick={this.trialapplications} id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
}
</div>
:
<div className="inline">
<a href="javascript:void(0);" onClick={this.props.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
</div>
}
</div>
<div className="edu-txt-center navInfo">
<div className="inline">
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'courses'})}
to={`/users/${username}/courses`}>课堂</Link>
</li>
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'shixuns'})}
to={`/users/${username}/shixuns`}>实训</Link>
</li>
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'paths'})}
to={`/users/${username}/paths`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>开发项目</Link>
</li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
<Link
onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link>
</li>
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
</div>
</div>
</div>
</div>
</div>
)
}
}
export default banner_out;

@ -0,0 +1,6 @@
/*global __webpack_public_path__ */
if (window._enableCDN && window.location.host == 'pre-newweb.educoder.net') {
__webpack_public_path__ = 'http://testali-cdn.educoder.net/react/build/'
} else if (window._enableCDN && window.location.host == 'www.educoder.net') {
__webpack_public_path__ = 'https://ali-newweb.educoder.net/react/build/'
}
Loading…
Cancel
Save