diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js
index 27844be53..884580a94 100644
--- a/app/assets/javascripts/admin.js
+++ b/app/assets/javascripts/admin.js
@@ -1,42 +1,42 @@
-//= require rails-ujs
-//= require activestorage
-//= require turbolinks
-//= require jquery3
-//= require popper
-//= require bootstrap-sprockets
-//= require jquery.validate.min
-//= require additional-methods.min
-//= require bootstrap-notify
-//= require jquery.cookie.min
-//= require select2
-//= require jquery.cxselect
-//= require bootstrap-datepicker
-
-//= require_tree ./i18n
-//= require_tree ./admins
-
-// ******** select2 global config ********
-$.fn.select2.defaults.set('theme', 'bootstrap4');
-$.fn.select2.defaults.set('language', 'zh-CN');
-
-Turbolinks.setProgressBarDelay(200);
-
-$(document).on('turbolinks:load', function(){
- $('[data-toggle="tooltip"]').tooltip();
- $('[data-toggle="popover"]').popover();
-
- // flash alert提示框自动关闭
- if($('.admin-alert-container .alert').length > 0){
- setTimeout(function(){
- $('.admin-alert-container .alert').alert('close');
- }, 2000);
- }
-});
-
-$(document).on("turbolinks:before-cache", function () {
- $('[data-toggle="tooltip"]').tooltip('hide');
- $('[data-toggle="popover"]').popover('hide');
-});
-
-$(function () {
+//= require rails-ujs
+//= require activestorage
+//= require turbolinks
+//= require jquery3
+//= require popper
+//= require bootstrap-sprockets
+//= require jquery.validate.min
+//= require additional-methods.min
+//= require bootstrap-notify
+//= require jquery.cookie.min
+//= require select2
+//= require jquery.cxselect
+//= require bootstrap-datepicker
+
+//= require_tree ./i18n
+//= require_tree ./admins
+
+// ******** select2 global config ********
+$.fn.select2.defaults.set('theme', 'bootstrap4');
+$.fn.select2.defaults.set('language', 'zh-CN');
+
+Turbolinks.setProgressBarDelay(200);
+
+$(document).on('turbolinks:load', function(){
+ $('[data-toggle="tooltip"]').tooltip();
+ $('[data-toggle="popover"]').popover();
+
+ // flash alert提示框自动关闭
+ if($('.admin-alert-container .alert').length > 0){
+ setTimeout(function(){
+ $('.admin-alert-container .alert').alert('close');
+ }, 2000);
+ }
+});
+
+$(document).on("turbolinks:before-cache", function () {
+ $('[data-toggle="tooltip"]').tooltip('hide');
+ $('[data-toggle="popover"]').popover('hide');
+});
+
+$(function () {
});
\ No newline at end of file
diff --git a/app/assets/javascripts/bootstrap-notify.js b/app/assets/javascripts/bootstrap-notify.js
old mode 100755
new mode 100644
diff --git a/app/assets/javascripts/bootstrap-notify.min.js b/app/assets/javascripts/bootstrap-notify.min.js
old mode 100755
new mode 100644
diff --git a/app/assets/javascripts/i18n/select2-i18n.zh-CN.js b/app/assets/javascripts/i18n/select2-i18n.zh-CN.js
old mode 100755
new mode 100644
diff --git a/app/assets/javascripts/jquery.cxselect.js b/app/assets/javascripts/jquery.cxselect.js
old mode 100755
new mode 100644
index 9bd674664..aeb3c17dd
--- a/app/assets/javascripts/jquery.cxselect.js
+++ b/app/assets/javascripts/jquery.cxselect.js
@@ -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 ? '' : '';
-
- // 区分标题、值的数据
- 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 += '';
- };
-
- // 数组即为值的数据
- } else {
- for (var i = 0, l = data.length; i < l; i++) {
- _html += '';
- };
- };
-
- _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 ? '' : '';
+
+ // 区分标题、值的数据
+ 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 += '';
+ };
+
+ // 数组即为值的数据
+ } else {
+ for (var i = 0, l = data.length; i < l; i++) {
+ _html += '';
+ };
+ };
+
+ _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;
+ };
+}));
diff --git a/app/assets/javascripts/jquery.cxselect.min.js b/app/assets/javascripts/jquery.cxselect.min.js
old mode 100755
new mode 100644
index 54549a920..9aabba447
--- a/app/assets/javascripts/jquery.cxselect.min.js
+++ b/app/assets/javascripts/jquery.cxselect.min.js
@@ -1,11 +1,11 @@
-/*!
- * 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
- */
+/*!
+ * 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(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery||window.Zepto||window.$)}(function(a){var b=function(){var d,e,f,g,h,i;for(g=0,h=arguments.length;h>g;g++)b.isJquery(arguments[g])||b.isZepto(arguments[g])?d=arguments[g]:b.isElement(arguments[g])?d=a(arguments[g]):"function"==typeof arguments[g]?f=arguments[g]:"object"==typeof arguments[g]&&(e=arguments[g]);return i=new b.init(d,e),"function"==typeof f&&f(i),i};b.isElement=function(a){return a&&("function"==typeof HTMLElement||"object"==typeof HTMLElement)&&a instanceof HTMLElement?!0:a&&a.nodeType&&1===a.nodeType?!0:!1},b.isJquery=function(a){return a&&a.length&&("function"==typeof jQuery||"object"==typeof jQuery)&&a instanceof jQuery?!0:!1},b.isZepto=function(a){return a&&a.length&&("function"==typeof Zepto||"object"==typeof Zepto)&&Zepto.zepto.isZ(a)?!0:!1},b.getIndex=function(a,b){return b?a:a-1},b.getData=function(a,b){if("string"==typeof b&&b.length){b=b.split(".");for(var c=0,d=b.length;d>c;c++)a=a[b[c]]}return a},b.init=function(c,d){var f,g,e=this;(b.isJquery(c)||b.isZepto(c))&&(f={dom:{box:c}},e.attach=b.attach.bind(f),e.detach=b.detach.bind(f),e.setOptions=b.setOptions.bind(f),e.clear=b.clear.bind(f),f.changeEvent=function(){b.selectChange.call(f,this.className)},f.settings=a.extend({},a.cxSelect.defaults,d,{url:f.dom.box.data("url"),emptyStyle:f.dom.box.data("emptyStyle"),required:f.dom.box.data("required"),firstTitle:f.dom.box.data("firstTitle"),firstValue:f.dom.box.data("firstValue"),jsonSpace:f.dom.box.data("jsonSpace"),jsonName:f.dom.box.data("jsonName"),jsonValue:f.dom.box.data("jsonValue"),jsonSub:f.dom.box.data("jsonSub")}),g=f.dom.box.data("selects"),"string"==typeof g&&g.length&&(f.settings.selects=g.split(",")),e.setOptions(),e.attach(),f.settings.url||f.settings.data?a.isArray(f.settings.data)?b.start.call(f,f.settings.data):"string"==typeof f.settings.url&&f.settings.url.length&&a.getJSON(f.settings.url,function(a){b.start.call(f,a)}):b.start.apply(f))},b.setOptions=function(c){var e,f,g,d=this;if(c&&a.extend(d.settings,c),(!a.isArray(d.selectArray)||!d.selectArray.length||c&&c.selects)&&(d.selectArray=[],a.isArray(d.settings.selects)&&d.settings.selects.length))for(f=0,g=d.settings.selects.length;g>f&&(e=d.dom.box.find("select."+d.settings.selects[f]),e&&e.length);f++)d.selectArray.push(e);c&&(!a.isArray(c.data)&&"string"==typeof c.url&&c.url.length?a.getJSON(d.settings.url,function(a){b.start.call(d,a)}):b.start.call(d,c.data))},b.attach=function(){var a=this;a.attachStatus||a.dom.box.on("change","select",a.changeEvent),"boolean"==typeof a.attachStatus&&b.start.call(a),a.attachStatus=!0},b.detach=function(){var a=this;a.dom.box.off("change","select",a.changeEvent),a.attachStatus=!1},b.clear=function(a){var d,e,b=this,c={display:"",visibility:""};for(a=isNaN(a)?0:a,d=a,e=b.selectArray.length;e>d;d++)b.selectArray[d].empty().prop("disabled",!0),"none"===b.settings.emptyStyle?c.display="none":"hidden"===b.settings.emptyStyle&&(c.visibility="hidden"),b.selectArray[d].css(c)},b.start=function(c){var e,f,d=this;if(a.isArray(c)&&(d.settings.data=b.getData(c,d.settings.jsonSpace)),d.selectArray.length){for(e=0,f=d.selectArray.length;f>e;e++)"string"!=typeof d.selectArray[e].attr("data-value")&&d.selectArray[e][0].options.length&&d.selectArray[e].attr("data-value",d.selectArray[e].val());d.settings.data||"string"==typeof d.selectArray[0].data("url")&&d.selectArray[0].data("url").length?b.getOptionData.call(d,0):d.selectArray[0].prop("disabled",!1).css({display:"",visibility:""})}},b.getOptionData=function(c){var f,g,h,i,j,k,l,m,n,o,p,d=this;if(!("number"!=typeof c||isNaN(c)||0>c||c>=d.selectArray.length))if(f=d.selectArray[c],i=f.data("url"),j="undefined"==typeof f.data("jsonSpace")?d.settings.jsonSpace:f.data("jsonSpace"),k={},b.clear.call(d,c),"string"==typeof i&&i.length){if(c>0)for(o=0,p=1;c>o;o++,p++)l=d.selectArray[p].data("queryName"),m=d.selectArray[o].attr("name"),n=d.selectArray[o].val(),"string"==typeof l&&l.length?k[l]=n:"string"==typeof m&&m.length&&(k[m]=n);a.getJSON(i,k,function(a){g=b.getData(a,j),b.buildOption.call(d,c,g)})}else if(d.settings.data&&"object"==typeof d.settings.data){for(g=d.settings.data,o=0;c>o;o++){if(h=b.getIndex(d.selectArray[o][0].selectedIndex,"boolean"==typeof d.selectArray[o].data("required")?d.selectArray[o].data("required"):d.settings.required),"object"!=typeof g[h]||!a.isArray(g[h][d.settings.jsonSub])||!g[h][d.settings.jsonSub].length){g=null;break}g=g[h][d.settings.jsonSub]}b.buildOption.call(d,c,g)}},b.buildOption=function(b,c){var k,l,m,d=this,e=d.selectArray[b],f="boolean"==typeof e.data("required")?e.data("required"):d.settings.required,g="undefined"==typeof e.data("firstTitle")?d.settings.firstTitle:e.data("firstTitle"),h="undefined"==typeof e.data("firstValue")?d.settings.firstValue:e.data("firstValue"),i="undefined"==typeof e.data("jsonName")?d.settings.jsonName:e.data("jsonName"),j="undefined"==typeof e.data("jsonValue")?d.settings.jsonValue:e.data("jsonValue");if(a.isArray(c)){if(k=f?"":'","string"==typeof i&&i.length)for("string"==typeof j&&j.length||(j=i),l=0,m=c.length;m>l;l++)k+='";else for(l=0,m=c.length;m>l;l++)k+='";e.html(k).prop("disabled",!1).css({display:"",visibility:""}),"string"==typeof e.attr("data-value")&&(e.val(String(e.attr("data-value"))).removeAttr("data-value"),e[0].selectedIndex<0&&(e[0].options[0].selected=!0)),(f||e[0].selectedIndex>0)&&e.trigger("change")}},b.selectChange=function(a){var d,e,f,c=this;if("string"==typeof a&&a.length){for(a=a.replace(/\s+/g,","),a=","+a+",",e=0,f=c.selectArray.length;f>e;e++)if(a.indexOf(","+c.settings.selects[e]+",")>-1){d=e;break}"number"==typeof d&&d>-1&&(d+=1,b.getOptionData.call(c,d))}},a.cxSelect=function(){return b.apply(this,arguments)},a.cxSelect.defaults={selects:[],url:null,data:null,emptyStyle:null,required:!1,firstTitle:"请选择",firstValue:"",jsonSpace:"",jsonName:"n",jsonValue:"",jsonSub:"s"},a.fn.cxSelect=function(b,c){return this.each(function(){a.cxSelect(this,b,c)}),this}});
\ No newline at end of file
diff --git a/app/assets/javascripts/jquery.validate.js b/app/assets/javascripts/jquery.validate.js
index 70297bd5c..d025319db 100644
--- a/app/assets/javascripts/jquery.validate.js
+++ b/app/assets/javascripts/jquery.validate.js
@@ -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 $;
}));
\ No newline at end of file
diff --git a/app/assets/javascripts/select2.js b/app/assets/javascripts/select2.js
old mode 100755
new mode 100644
diff --git a/app/assets/javascripts/select2.min.js b/app/assets/javascripts/select2.min.js
old mode 100755
new mode 100644
diff --git a/app/assets/stylesheets/select2-bootstrap4.min.scss b/app/assets/stylesheets/select2-bootstrap4.min.scss
old mode 100755
new mode 100644
diff --git a/app/assets/stylesheets/select2.min.scss b/app/assets/stylesheets/select2.min.scss
old mode 100755
new mode 100644
diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js
index 510bcaa4f..f126bc363 100644
--- a/public/react/config/webpack.config.dev.js
+++ b/public/react/config/webpack.config.dev.js
@@ -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.
diff --git a/public/react/src/common/components/attachment/AttachmentList.js b/public/react/src/common/components/attachment/AttachmentList.js
index 8ece1c39d..afc55fe1f 100644
--- a/public/react/src/common/components/attachment/AttachmentList.js
+++ b/public/react/src/common/components/attachment/AttachmentList.js
@@ -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(
-
+
{
item.is_pdf && item.is_pdf == true ?
- {item.title}
+ 30 }>
+ {item.title}
+
:
- {item.title}
+ 30 }>
+ {item.title}
+
}
{item.filesize}
diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js
index b02f6a73f..bb8d3db43 100644
--- a/public/react/src/modules/courses/boards/BoardsNew.js
+++ b/public/react/src/modules/courses/boards/BoardsNew.js
@@ -365,10 +365,15 @@ class BoardsNew extends Component{
dropdownRender={menu => (
{menu}
-
-
this.refs['addDirModal'].open()}>
- 添加目录
-
+ {
+ isAdmin &&
+
+
+ this.refs['addDirModal'].open()}>
+ 添加目录
+
+
+ }
)}
>
diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js
index 432c597ee..542157bfb 100644
--- a/public/react/src/modules/courses/boards/TopicDetail.js
+++ b/public/react/src/modules/courses/boards/TopicDetail.js
@@ -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
@@ -599,51 +601,54 @@ class TopicDetail extends Component {
}
-
-
{moment(memo.created_on).fromNow()} 发布
-
-
-
-
-
-
-
- {/* { current_user.admin &&
-
-
-
- } */}
-
-
-
- {memo.visits || '1'}
-
-
- { !!memo.total_replies_count &&
-
-
-
- { memo.total_replies_count }
-
-
- }
- {!!memo.praises_count &&
-
-
-
- { memo.praises_count }
+
+

+
+
+ {author && author.name}
+ {moment(memo.created_on).fromNow()} 发布
+
+
+
+
+ {/* { current_user.admin &&
+
+
-
+ } */}
+
+
+
+ {memo.visits || '1'}
+
+
+ { !!memo.total_replies_count &&
+
+
+
+ { memo.total_replies_count }
+
+
}
-
-
+ {!!memo.total_praises_count &&
+
+
+
+ { memo.total_praises_count }
+
+
+ }
+
+
+
+
diff --git a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
index a092c5066..4177be8a4 100644
--- a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
+++ b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js
@@ -85,8 +85,7 @@ class WorkDetailPageHeader extends Component{
background: #fff;
}
.workDetailPageHeader .summaryname {
- line-height: 20px;
- margin-top: 13px;
+ line-height:30px
}
`}
-
-
+
+
{homework_name}
{/* {homework_name} */}
- {category &&
返回}
+ {category &&
返回}
{this.props.update_atta &&
diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js
index f9c34cfcf..d5ac0be68 100644
--- a/public/react/src/modules/courses/busyWork/commonWork.js
+++ b/public/react/src/modules/courses/busyWork/commonWork.js
@@ -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);
diff --git a/public/react/src/modules/courses/coursesPublic/NoneData.js b/public/react/src/modules/courses/coursesPublic/NoneData.js
index 73406ab5c..35d7a5271 100644
--- a/public/react/src/modules/courses/coursesPublic/NoneData.js
+++ b/public/react/src/modules/courses/coursesPublic/NoneData.js
@@ -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(
-
}/)
+
+
暂时还没有相关数据哦!
)
diff --git a/public/react/src/modules/courses/coursesPublic/modal/SendToCourseModal.js b/public/react/src/modules/courses/coursesPublic/modal/SendToCourseModal.js
index af3fc1a30..c4c306a12 100644
--- a/public/react/src/modules/courses/coursesPublic/modal/SendToCourseModal.js
+++ b/public/react/src/modules/courses/coursesPublic/modal/SendToCourseModal.js
@@ -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(
-
-
- 选择的{moduleName}发送到指定课堂
-
-
-
-
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { course_lists && course_lists.map( course => {
- return (
-
-
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
- {/* TODO */}
- {/* {
- !hasMore && 没有更多了。。
- } */}
-
-
-
-
- )
- }
-}
-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(
+
+
+ 选择的{moduleName}发送到指定课堂
+
+
+
+
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+
+ { course_lists && course_lists.map( course => {
+ return (
+
+
+
+
+ )
+ }) }
+
+ {loading && hasMore && (
+
+
+
+ )}
+ {/* TODO */}
+ {/* {
+ !hasMore && 没有更多了。。
+ } */}
+
+
+
+
+ )
+ }
+}
+export default SendToCourseModal;
+
+
diff --git a/public/react/src/modules/courses/css/members.css b/public/react/src/modules/courses/css/members.css
index ff6f0d99d..df3f884d9 100644
--- a/public/react/src/modules/courses/css/members.css
+++ b/public/react/src/modules/courses/css/members.css
@@ -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;
}
\ No newline at end of file
diff --git a/public/react/src/modules/courses/exercise/Exercise.js b/public/react/src/modules/courses/exercise/Exercise.js
index 4331bdc6f..044dc87f0 100644
--- a/public/react/src/modules/courses/exercise/Exercise.js
+++ b/public/react/src/modules/courses/exercise/Exercise.js
@@ -559,7 +559,7 @@ class Exercise extends Component{
{...this.props}
{...this.state}
item={item}
- key={key}
+ index={key}
checkBox={ this.onItemClick(item)}
>}
diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js
index e890b92ef..5248f4c1a 100644
--- a/public/react/src/modules/courses/exercise/ExerciseListItem.js
+++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js
@@ -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(
-
+
window.$(`.exerciseitem${index} input`).click() }>
{
- IsAdmin &&
-
+ IsAdmin &&
+
{checkBox}
}
@@ -96,20 +96,20 @@ class ExerciseListItem extends Component{
{/*{item.exercise_name}*/}
{
- this.props.isAdmin()? {item.exercise_name}:""
+ to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}:""
}
{
this.props.isStudent()?
- {item.exercise_name}:""
+ {item.exercise_name}:""
}
{
this.props.isNotMember()? item.lock_status === 0 ?
{item.exercise_name}
- : {item.exercise_name}:""
+ : {item.exercise_name}:""
}
{
@@ -165,8 +165,8 @@ class ExerciseListItem extends Component{
{ IsAdmin && }
@@ -193,7 +193,7 @@ class ExerciseListItem extends Component{
}
diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js
index cdbc7218b..f38ad7435 100644
--- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js
+++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js
@@ -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;
+ }
`}
{/*
*/}
-
+
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.`
return(
- {prefix}
- {/* */}
- {/* */}
-
+
+ {prefix}
+
+
)
})
diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js
index a879bad74..5156019d4 100644
--- a/public/react/src/modules/courses/exercise/question/single.js
+++ b/public/react/src/modules/courses/exercise/question/single.js
@@ -40,18 +40,18 @@ class single extends Component{
let isJudge = questionType.question_type == 2
return(
-
+
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = isJudge ? undefined : `${tagArray[key]}.`
return(
-
- {prefix}
- {/* */}
- {/* */}
-
+
+
+ {prefix}
+
+
)
})
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js
index d30944ef0..92a4832db 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js
@@ -151,16 +151,12 @@ class GraduateTaskItem extends Component{
coursesId,
categoryid,
taskid,
-
+ index,
+ isAdmin
} = this.props;
- // console.log(discussMessage)
-
-
-
-
return(
-
+
window.$(`.taskitem${index} input`).click() }>
- { checkBox }
-
+
+ { checkBox }
+
{/*
style={{borderTop:data===undefined?"":data.course_identity<4?'1px solid #EBEBEB':'1px solid transparent'}}
*/}
diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js
index b54815b2f..1610ff772 100644
--- a/public/react/src/modules/courses/graduation/tasks/index.js
+++ b/public/react/src/modules/courses/graduation/tasks/index.js
@@ -384,7 +384,9 @@ class GraduationTasks extends Component{
this.setState({
order: e.key,
- isSpin:true
+ isSpin:true,
+ checkBoxValues:[],
+ checkAllValue:false
});
let newkey=e.key;
@@ -729,7 +731,7 @@ class GraduationTasks extends Component{
{ tasks.map((item, index) => {
// console.log(item)
return (
-
+
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
index 0c76cd9de..9ba334421 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js
@@ -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 &&
- {
+ {/* {
topicInfo.attachment_list.map((item,key)=>{
return(
+
30 }>
@@ -72,7 +73,8 @@ class GraduateTopicDetailTable extends Component{
)
})
- }
+ } */}
+
}
diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
index 9f61e69d4..bac04c699 100644
--- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
+++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js
@@ -47,7 +47,7 @@ class GraduateTopicItem extends Component{
}
-
+
window.$(`.topicItem${index} input`).click() }>
- { isAdmin ? checkBox : ""}
+ { isAdmin ?
{checkBox} : ""}
-
- {/*
*/}
-
-
-
-
-
-
-
-
-
-
-
- { loading || users.length ?
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { users.map( candidate => {
- return (
-
-
-
- 12 }>
-
-
-
-
- 12 }>
-
-
-
-
-
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
- {course_groups && course_groups.length &&
- 所选学生分班至(选填):
-
-
}
-
: }
-
-
- )
- }
-}
-
-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(
+
+
+
+ {/* */}
+
+
+
+
+
+
+
+
+
+
+
+ { loading || users.length ?
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+
+ { users.map( candidate => {
+ return (
+
+
+
+ 12 }>
+
+
+
+
+ 12 }>
+
+
+
+
+
+
+
+ )
+ }) }
+
+ {loading && hasMore && (
+
+
+
+ )}
+
+
+
+ {course_groups && course_groups.length &&
+ 所选学生分班至(选填):
+
+
}
+
: }
+
+
+ )
+ }
+}
+
+AddStudentModal.contextType = ThemeContext;
+export default AddStudentModal;
diff --git a/public/react/src/modules/courses/members/modal/AddTeacherModal.js b/public/react/src/modules/courses/members/modal/AddTeacherModal.js
index 21902a782..b397f7838 100644
--- a/public/react/src/modules/courses/members/modal/AddTeacherModal.js
+++ b/public/react/src/modules/courses/members/modal/AddTeacherModal.js
@@ -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(
-
-
-
-
- {/* graduation_groups && !!graduation_groups.length */}
-
-
-
-
-
-
-
-
-
-
- { loading || candidates.length ?
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { candidates && candidates.map( candidate => {
- return (
-
-
-
- {/* "color":"#4c4c4c" */}
- 12 }>
-
-
-
-
- 12 }>
-
-
-
-
-
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
-
: }
-
- { this.hasGraduationModule() &&
-
添加至答辩组:
-
-
}
-
- { course_groups && !!course_groups.length &&
- 管理权限:
-
-
}
-
-
- )
- }
-}
-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(
+
+
+
+
+ {/* graduation_groups && !!graduation_groups.length */}
+
+
+
+
+
+
+
+
+
+
+ { loading || candidates.length ?
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+
+ { candidates && candidates.map( candidate => {
+ return (
+
+
+
+ {/* "color":"#4c4c4c" */}
+ 12 }>
+
+
+
+
+ 12 }>
+
+
+
+
+
+
+
+ )
+ }) }
+
+ {loading && hasMore && (
+
+
+
+ )}
+
+
+
+
: }
+
+ { this.hasGraduationModule() &&
+
添加至答辩组:
+
+
}
+
+ { course_groups && !!course_groups.length &&
+ 管理权限:
+
+
}
+
+
+ )
+ }
+}
+export default AddTeacherModal;
diff --git a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
index 54c0df912..d5e77da9d 100644
--- a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
+++ b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
@@ -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"
>
-
-
-
-
- 点击或拖拽文件到这里上传
-
- 单个文件最大150MB
-
-
-
- {errorTip}
-
+
+
+
+
+ 点击或拖拽文件到这里上传
+
+ 单个文件最大150MB
+
+
)
}
diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js
index 07be2196c..b064c289b 100644
--- a/public/react/src/modules/courses/poll/Poll.js
+++ b/public/react/src/modules/courses/poll/Poll.js
@@ -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,7 @@ class Poll extends Component{
{...this.state}
courseType={course_types}
item={item}
- key={key}
+ index={key}
checkBox={
this.onItemClick(item)}>}
>
)
diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js
index 50c471e76..c4f1c8209 100644
--- a/public/react/src/modules/courses/poll/PollListItem.js
+++ b/public/react/src/modules/courses/poll/PollListItem.js
@@ -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(
-
+
window.$(`.pollitem${index} input`).click() }>
{
IsAdmin &&
-
+
{checkBox}
}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index 38ab63a4f..942c06800 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -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(
-
- {this.state.ModalsRenametype===true?
-
this.cannerNavmoda()}
- />
- :""}
-
-
-
- {visible===true?:""}
-
-
-
-
-
-
-
-
-
本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战
-
-
-
- {/**/}
- {/*知道了*/}
- {/*
*/}
-
-
+
+ {
+ this.state.ModalsRenametype===true?
+ this.cannerNavmoda()}
+ />
+ :""}
+
+ {visible===true?:""}
+
+
+
+
+
+
+
+
本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战
+
+
+
+ {/**/}
+ {/*知道了*/}
+ {/*
*/}
+
+ window.$(`.shixunitem${index} input`).click() } >
- {this.props.isAdmin?checkBox:""}
+ {this.props.isAdmin?
+
{checkBox}
+ :
+ ""
+ }
+
)
}
}
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index 74d142129..cdbac6760 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -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;
@@ -1019,8 +1021,8 @@ class ShixunHomework extends Component{
- {datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}
- {/* 实训作业*/}
+ {/*{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}*/}
+ 实训作业
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
@@ -1161,8 +1163,9 @@ class ShixunHomework extends Component{
isStudent={this.props.isStudent()}
isNotMember={this.props.isNotMember()}
isClassManagement={this.props.isClassManagement()}
- checkBox={this.props.isAdmin()?:""}
+ checkBox={this.props.isAdmin()?:""}
match={this.props.match}
+ index={index}
coursedata={this.props.coursedata}
coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)}
course_identity={datas.course_identity}
diff --git a/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css b/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css
index f3c4a30da..4470aaec1 100644
--- a/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css
+++ b/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css
@@ -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;
}
\ No newline at end of file
diff --git a/public/react/src/modules/user/usersInfo/InfosBank.js b/public/react/src/modules/user/usersInfo/InfosBank.js
index 8adc7ba50..2abc15220 100644
--- a/public/react/src/modules/user/usersInfo/InfosBank.js
+++ b/public/react/src/modules/user/usersInfo/InfosBank.js
@@ -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(
-
-
-
-
-
-
-
-
- - this.changeCourseListId()}>
- 全部
-
- {
- data && data.course_list && data.course_list.map((item,key)=>{
- return(
- - this.changeCourseListId(`${item.id}`)}>
- {item.name}
-
- )
- })
- }
-
-
-
-
- 共参与{totalCount}个题库
-
-
- {sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}
-
- - this.changeOrder("updated_at")}>时间最新
- - this.changeOrder("name")}>作业名称
- - this.changeOrder("contributor")}>贡献者
-
-
-
-
-
- {
- !data || data.question_banks.length==0 &&
- }
- {
- data && data.question_banks && data.question_banks.map((item,key)=>{
- return(
-
- )
- })
- }
-
- {
- totalCount > 15 &&
-
- }
-
-
- )
- }
-}
+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(
+
+
+
+
+
+
+
+
+ - this.changeCourseListId()}>
+ 全部
+
+ {
+ data && data.course_list && data.course_list.map((item,key)=>{
+ return(
+ - this.changeCourseListId(`${item.id}`)}>
+ {item.name}
+
+ )
+ })
+ }
+
+
+
+
+ 共参与{totalCount}个题库
+
+
+ {sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}
+
+ - this.changeOrder("updated_at")}>时间最新
+ - this.changeOrder("name")}>作业名称
+ - this.changeOrder("contributor")}>贡献者
+
+
+
+
+
+ {
+ !data || data.question_banks.length==0 &&
+ }
+ {
+ data && data.question_banks && data.question_banks.map((item,key)=>{
+ return(
+
+ )
+ })
+ }
+
+ {
+ totalCount > 15 &&
+
+ }
+
+
+ )
+ }
+}
export default InfosBank;
\ No newline at end of file
diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js
index 92dd4f1d2..08bea57ed 100644
--- a/public/react/src/modules/user/usersInfo/InfosBanner.js
+++ b/public/react/src/modules/user/usersInfo/InfosBanner.js
@@ -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(
-
-
-
-

-
-
- {data && data.name}
- {
- data && is_current == false && data.identity =="学生" ? "" :
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- is_current ?
-
- {
- data && data.attendance_signed ?
- 已签到
- :
- 签到
- }
-
- :
-
- 私信
-
- }
-
-
-
-
- this.setState({moduleName: 'courses'})}
- to={`/users/${username}/courses`}>翻转课堂
-
-
- this.setState({moduleName: 'shixuns'})}
- to={`/users/${username}/shixuns`}>实训项目
-
-
- this.setState({moduleName: 'paths'})}
- to={`/users/${username}/paths`}>实践课程
-
-
- this.setState({moduleName: 'projects'})}
- to={`/users/${username}/projects`}>开发项目
-
-
- this.setState({moduleName: 'package'})}
- to={`/users/${username}/package`}>众包
-
- {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
- &&
- this.setState({moduleName: 'videos'})}
- to={`/users/${username}/videos`}>视频
- }
-
-
-
- )
- }
-}
+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(
+
+
+
+

+
+
+ {data && data.name}
+ {
+ data && is_current == false && data.identity =="学生" ? "" :
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ is_current ?
+
+ {
+ data && data.attendance_signed ?
+ 已签到
+ :
+ 签到
+ }
+
+ :
+
+
+ 私信
+
+
+ }
+
+
+
+
+ this.setState({moduleName: 'courses'})}
+ to={`/users/${username}/courses`}>翻转课堂
+
+
+ this.setState({moduleName: 'shixuns'})}
+ to={`/users/${username}/shixuns`}>开发社区
+
+
+ this.setState({moduleName: 'paths'})}
+ to={`/users/${username}/paths`}>实践课程
+
+
+ this.setState({moduleName: 'projects'})}
+ to={`/users/${username}/projects`}>项目
+
+
+ this.setState({moduleName: 'package'})}
+ to={`/users/${username}/package`}>众包
+
+ {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
+ &&
+ this.setState({moduleName: 'videos'})}
+ to={`/users/${username}/videos`}>视频
+ }
+
+
+
+ )
+ }
+}
export default InfosBanner;
\ No newline at end of file
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index c4c1c77e0..bc401d4d7 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -130,7 +130,7 @@ class InfosCourse extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? : ""
}
{
- (!data || data.courses.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) &&
+ (!data || (data && data.courses.length==0)) && category &&
}
{
data && data.courses && data.courses.map((item,key)=>{
diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js
index cb02ed604..554d8380f 100644
--- a/public/react/src/modules/user/usersInfo/InfosPath.js
+++ b/public/react/src/modules/user/usersInfo/InfosPath.js
@@ -152,7 +152,7 @@ class InfosPath extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? :""
}
{
- (!data || data.subjects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) &&
+ (!data || (data && data.subjects.length==0)) && category &&
}
{
data && data.subjects && data.subjects.map((item,key)=>{
diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js
index 2018f7b73..5aea5117b 100644
--- a/public/react/src/modules/user/usersInfo/InfosProject.js
+++ b/public/react/src/modules/user/usersInfo/InfosProject.js
@@ -125,7 +125,7 @@ class InfosProject extends Component{
:""
}
{
- (!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) &&
+ (!data || (data && data.projects.length==0)) && category &&
}
{
data && data.projects && data.projects.map((item,key)=>{
diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js
index 94ef3c29b..4799626a9 100644
--- a/public/react/src/modules/user/usersInfo/InfosShixun.js
+++ b/public/react/src/modules/user/usersInfo/InfosShixun.js
@@ -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(
@@ -157,20 +154,18 @@ class InfosShixun extends Component{
{
- 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 != "学生" ?
:""
}
{
- (!data || data.shixuns.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) &&
+ (!data || (data && data.shixuns.length==0)) && category &&
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{
return(