From 1250c6e664ee1fc4bfdc9fae064deb8c311fec98 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 4 Sep 2019 17:55:43 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=9C=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_commons_controller.rb | 2 ++
app/controllers/shixuns_controller.rb | 1 +
app/controllers/subjects_controller.rb | 1 +
app/services/homeworks_service.rb | 1 -
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb
index 8c8d121d1..b62840200 100644
--- a/app/controllers/homework_commons_controller.rb
+++ b/app/controllers/homework_commons_controller.rb
@@ -930,6 +930,7 @@ class HomeworkCommonsController < ApplicationController
shixuns.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, @category, current_user
@homework_ids << homework.id
+ CreateStudentWorkJob.perform_later(homework.id)
end
rescue Exception => e
uid_logger(e.message)
@@ -1031,6 +1032,7 @@ class HomeworkCommonsController < ApplicationController
stage.shixuns.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user
@homework_ids << homework.id
+ CreateStudentWorkJob.perform_later(homework.id)
end
end
end
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index e910db8cc..b47a9a346 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -909,6 +909,7 @@ class ShixunsController < ApplicationController
def send_to_course
@course = Course.find(params[:course_id])
homework = HomeworksService.new.create_homework @shixun, @course, nil, current_user
+ CreateStudentWorkJob.perform_later(homework.id)
end
# 二维码扫描下载
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index d97b7172c..7c76748b1 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -214,6 +214,7 @@ class SubjectsController < ApplicationController
stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user
+ CreateStudentWorkJob.perform_later(homework.id)
end
end
rescue Exception => e
diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb
index f6868afba..0dc814c89 100644
--- a/app/services/homeworks_service.rb
+++ b/app/services/homeworks_service.rb
@@ -15,7 +15,6 @@ class HomeworksService
homework_detail_manual.save! if homework_detail_manual
HomeworkCommonsShixun.create!(homework_common_id: homework.id, shixun_id: shixun.id)
HomeworksService.new.create_shixun_homework_cha_setting(homework, shixun)
- CreateStudentWorkJob.perform_later(homework.id)
# HomeworksService.new.create_works_list(homework, course)
end
homework
From 6cf21f155f493be62e719fa5d6b7930c6e32a113 Mon Sep 17 00:00:00 2001
From: SylorHuang "+text+"
diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb
index 11584909d..64b4ee70b 100644
--- a/app/views/admins/departments/shared/_department_item.html.erb
+++ b/app/views/admins/departments/shared/_department_item.html.erb
@@ -28,7 +28,8 @@
<%= javascript_void_link '添加管理员', class: 'action', data: { department_id: department.id, toggle: 'modal', target: '.admin-add-department-member-modal' } %>
- <%= javascript_void_link '更改', class: 'action', data: { school_id: department.school_id, department_id: department.id, toggle: 'modal', target: '.admin-merge-department-modal' } %>
+ <%= javascript_void_link '更改', class: 'action', data: { school_id: department.school_id, department_id: department.id,
+ toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_departments_path } %>
<%= delete_link '删除', admins_department_path(department, element: ".department-item-#{department.id}"), class: 'delete-department-action' %>
\ No newline at end of file
diff --git a/app/views/admins/departments/shared/_merge_department_modal.html.erb b/app/views/admins/departments/shared/_merge_department_modal.html.erb
index 200e75ccd..5c1ca6892 100644
--- a/app/views/admins/departments/shared/_merge_department_modal.html.erb
+++ b/app/views/admins/departments/shared/_merge_department_modal.html.erb
@@ -18,7 +18,6 @@
-
diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb
index 96d67b52a..9a7c696b8 100644
--- a/app/views/admins/shared/_sidebar.html.erb
+++ b/app/views/admins/shared/_sidebar.html.erb
@@ -56,7 +56,8 @@
<%= sidebar_item_group('#apply-review-submenu', '审核', icon: 'gavel') do %>
-
@@ -14,8 +14,8 @@
<% applies.each do |apply| %>
ID
- 部门名称
- 单位名称
+ ID
+ 部门名称
+ 单位名称
创建者
<%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %>
- 操作
+ 操作
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
-
<%= apply.id %>
- <%= apply.name %>
- <%= apply.school.try(:name) %>
+ <%= apply.name %>
+ <%= apply.school.try(:name) %>
<%= apply.user.show_real_name %>
<%= format_time apply.created_at %>
@@ -23,17 +23,16 @@
<%= javascript_void_link('删除', class: 'action refuse-action',
data: {
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, title: "删除原因", type: "delete",
- url: admins_department_apply_path(apply, element: ".department-apply-#{apply.id}")
+ url: admins_department_apply_path(apply,tip:"unapplied", element: ".department-apply-#{apply.id}")
}) %>
-
- <%= javascript_void_link('修改', class: 'action department-apply-action', data: { toggle: 'modal', target: '.department-apply-edit-modal', id: apply.id }) %>
+ <%= javascript_void_link '更改', class: 'action', data: { school_id: apply.school_id, department_id: apply.id,
+ toggle: 'modal', target: '.admin-merge-department-modal', url: merge_admins_department_applies_path } %>
<%= apply.id %>
+<%= overflow_hidden_span apply.name %>
+
+ <%= "#{apply&.province.to_s}"+"#{apply&.city.to_s}" %>
+
+<%= overflow_hidden_span apply.address %>
+<%= apply.user.try(:show_real_name) %>
+<%= format_time apply.created_at %>
+
+ <%= agree_link '批准', agree_admins_unit_apply_path(apply, element: ".unit-apply-#{apply.id}"), 'data-confirm': '确认批准通过?' %>
+ <%= javascript_void_link('删除', class: 'action refuse-action',
+ data: {
+ toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id, title: "删除原因", type: "delete",
+ url: admins_unit_apply_path(apply, tip: "unapplied", element: ".unit-apply-#{apply.id}")
+ }) %>
+ <%= link_to "更改",edit_admins_unit_apply_path(apply), remote: true, class:"action",'data-disable-with': '打开中...' %>
+
\ No newline at end of file
diff --git a/app/views/admins/unit_applies/shared/_edit_modal.html.erb b/app/views/admins/unit_applies/shared/_edit_modal.html.erb
new file mode 100644
index 000000000..6f8995ae0
--- /dev/null
+++ b/app/views/admins/unit_applies/shared/_edit_modal.html.erb
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/app/views/admins/unit_applies/shared/_list.html.erb b/app/views/admins/unit_applies/shared/_list.html.erb
new file mode 100644
index 000000000..c28ce7967
--- /dev/null
+++ b/app/views/admins/unit_applies/shared/_list.html.erb
@@ -0,0 +1,26 @@
+
+
+
+
+<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
\ No newline at end of file
diff --git a/app/views/admins/unit_applies/update.js.erb b/app/views/admins/unit_applies/update.js.erb
new file mode 100644
index 000000000..725f926d0
--- /dev/null
+++ b/app/views/admins/unit_applies/update.js.erb
@@ -0,0 +1,6 @@
+$('.modal.admin-unit-edit-modal').modal('hide');
+//$(".modal.admin-unit-edit-modal").remove()
+//$("body").removeClass("modal-open")
+$('.unit-applies-list-table .unit-apply-<%= @unit_apply.id %>').remove()
+//$('.unit-applies-list-table .unit-apply-<%= @unit_apply.id %>').html("<%= j render partial: "admins/unit_applies/shared/apply_item", locals: {apply: @unit_apply} %>")
+$.notify({ message: '操作成功' });
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 36d4bcfab..108630366 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -850,7 +850,15 @@ Rails.application.routes.draw do
end
resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update]
- resources :department_applies,only: [:index,:edit,:update,:destroy] do
+ resources :department_applies,only: [:index,:destroy] do
+ collection do
+ post :merge
+ end
+ member do
+ post :agree
+ end
+ end
+ resources :unit_applies,only: [:index,:destroy,:edit,:update] do
member do
post :agree
end
From 66e2c3a61ac3fdb1a847add13531cddb93a614ff Mon Sep 17 00:00:00 2001
From: SylorHuang
+
+
+
+ <% if applies.present? %>
+ <% applies.each do |apply| %>
+ ID
+ 单位名称
+ 地区
+ 详细地址
+ 申请者
+ <%= sort_tag('创建于', name: 'created_at', path: admins_unit_applies_path) %>
+ 操作
+
+ <%= render partial: "admins/unit_applies/shared/apply_item", locals: {apply: apply} %>
+
+ <% end %>
+ <% else %>
+ <%= render 'admins/shared/no_data_for_table' %>
+ <% end %>
+
+
') { out+=this.options.sanitize?escape(cap[0]):cap[0]; }
+
+ out+=this.renderer.em(this.output(cap[2]||cap[1])) -->
+ out+=this.renderer.em(this.output(cap[2]||cap[1]), cap.input)
*/
(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
"}return'"+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"'+(escaped?code:escape(code,true))+"\n
\n"+quote+"
\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
\n":"
\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+""+type+">\n"};Renderer.prototype.listitem=function(text){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
\n"};Renderer.prototype.tablerow=function(content){return"\n"+content+" \n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+""+type+">\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?"
":"
"};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='"+text+"";return out};Renderer.prototype.image=function(href,title,text){var out='":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i
"+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/public/react/public/js/editormd/editormd.min.js b/public/react/public/js/editormd/editormd.min.js index 79c072919..ac3deac1a 100755 --- a/public/react/public/js/editormd/editormd.min.js +++ b/public/react/public/js/editormd/editormd.min.js @@ -3601,9 +3601,9 @@ return text; }; - markedRenderer.em = function (text) { - if (text && text.indexOf('$$') != -1) { - return text; + markedRenderer.em = function (text, capInput) { + if (text && text.indexOf('$$') != -1 || (capInput && capInput.indexOf('$$') != -1)) { + return '_' + text + '_'; } else { return '' + text + ''; } diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js index 6d0838c59..57606faa6 100755 --- a/public/react/public/js/js_min_all.js +++ b/public/react/public/js/js_min_all.js @@ -83,7 +83,7 @@ function AssertException(message){this.message=message}function assert(exp,messa * {@link https://github.com/pandao/editor.md} * @updateTime 2015-06-09 */ -function initEditormdPasteUpload(e,t,i){e.cm.getInputField().addEventListener("paste",function(i){_whenPasterDoUpload(i,t,function(t){t.id&&e.cm.replaceSelection("![](/api/attachments/"+t.id+")")})})}!function(e){"use strict";"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define?define.amd||define(["../../../../editormd/examples/js/jquery.min"],e):window.editormd=e()}(function(){"use strict";var e="undefined"!=typeof jQuery?jQuery:Zepto;if(void 0!==e){var t,i,o,r=function(e,t){return new r.fn.init(e,t)};r.title=r.$name="Editor.md",r.version="1.5.0",r.homePage="https://pandao.github.io/editor.md/",r.classPrefix="editormd-",r.toolbarModes={full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"],simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],mini:["undo","redo","|","watch","preview","|","help","info"]},r.defaults={mode:"gfm",name:"",value:"",theme:"",editorTheme:"default",previewTheme:"",markdown:"",appendMarkdown:"",width:"100%",height:"100%",path:"./lib/",pluginPath:"",delay:300,autoLoadModules:!0,watch:!0,placeholder:"Enjoy Markdown! coding now...",gotoLine:!0,codeFold:!1,autoHeight:!1,autoFocus:!0,autoCloseTags:!0,searchReplace:!0,syncScrolling:!0,readOnly:!1,tabSize:4,indentUnit:4,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,showTrailingSpace:!0,matchBrackets:!0,indentWithTabs:!0,styleSelectedText:!0,matchWordHighlight:!0,styleActiveLine:!0,dialogLockScreen:!0,dialogShowMask:!0,dialogDraggable:!0,dialogMaskBgColor:"#fff",dialogMaskOpacity:.1,fontSize:"13px",saveHTMLToTextarea:!1,disabledKeyMaps:[],onload:function(){},onresize:function(){},onchange:function(){},onwatch:null,onunwatch:null,onpreviewing:function(){},onpreviewed:function(){},onfullscreen:function(){},onfullscreenExit:function(){},onscroll:function(){},onpreviewscroll:function(){},imageUpload:!1,imageFormats:["jpg","jpeg","gif","png","bmp","webp"],imageUploadURL:"",crossDomainUpload:!1,uploadCallbackURL:"",toc:!0,tocm:!1,tocTitle:"",tocDropdown:!1,tocContainer:"",tocStartLevel:1,htmlDecode:"style,iframe|on*",pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0,toolbar:!0,toolbarAutoFixed:!0,toolbarIcons:"full",toolbarTitles:{},toolbarHandlers:{ucwords:function(){return r.toolbarHandlers.ucwords},lowercase:function(){return r.toolbarHandlers.lowercase}},toolbarCustomIcons:{lowercase:'a',ucwords:'Aa'},toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",uppercase:"fa-font",h1:r.classPrefix+"bold",h2:r.classPrefix+"bold",h3:r.classPrefix+"bold",h4:r.classPrefix+"bold",h5:r.classPrefix+"bold",h6:r.classPrefix+"bold","list-ul":"fa-list-ul","list-ol":"fa-list-ol",hr:"fa-minus",link:"fa-link","reference-link":"fa-anchor",image:"fa-picture-o",code:"fa-code","preformatted-text":"fa-file-code-o","code-block":"fa-file-code-o",table:"fa-table",datetime:"fa-clock-o",emoji:"fa-smile-o","html-entities":"fa-copyright",pagebreak:"fa-newspaper-o","goto-line":"fa-terminal",watch:"fa-eye-slash",unwatch:"fa-eye",preview:"fa-desktop",search:"fa-search",fullscreen:"fa-arrows-alt",clear:"fa-eraser",help:"fa-question-circle",info:"fa-info-circle"},toolbarIconTexts:{},lang:{name:"zh-cn",description:"开源在线Markdown编辑器
"+this.atLink(this.emoji(e))+"
\n"},s.code=function(e,t,i){return"seq"===t||"sequence"===t?''+e+"
":n.Renderer.prototype.code.apply(this,arguments)},s.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+this.atLink(this.emoji(e))+""+i+">\n"},s.listitem=function(e){return o.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'"+this.atLink(this.emoji(e))+"
\n"},s.code=function(e,t,i){return"seq"===t||"sequence"===t?''+e+"
":n.Renderer.prototype.code.apply(this,arguments)},s.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+this.atLink(this.emoji(e))+""+i+">\n"},s.listitem=function(e){return o.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'"+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
"+text+"
\n"};Renderer.prototype.table=function(header,body){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?""+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file +// (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
"+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
"+text+"
\n"};Renderer.prototype.table=function(header,body){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?""+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); + +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +;(function() { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, + text: /^[^\n]+/ +}; + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + +block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /
'
+ + (escaped ? code : escape(code, true))
+ + '\n
';
+ }
+
+ return ''
+ + (escaped ? code : escape(code, true))
+ + '\n
\n';
+};
+
+Renderer.prototype.blockquote = function(quote) {
+ return '\n' + quote + '\n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + return '
' + text + '
\n'; +}; + +Renderer.prototype.table = function(header, body) { + return '' + text + '
';
+};
+
+Renderer.prototype.br = function() {
+ return this.options.xhtml ? 'An error occured:
' + + escape(e.message + '', true) + + ''; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +if (typeof module !== 'undefined' && typeof exports === 'object') { + module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); +} else { + this.marked = marked; +} + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); \ No newline at end of file From 11acc5a107db61e97878aac630b7176bd28e3913 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 5 Sep 2019 10:12:21 +0800 Subject: [PATCH 13/17] , cap.input --- public/editormd/lib/marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/editormd/lib/marked.min.js b/public/editormd/lib/marked.min.js index 79cd041ec..1492f0af5 100644 --- a/public/editormd/lib/marked.min.js +++ b/public/editormd/lib/marked.min.js @@ -667,7 +667,7 @@ InlineLexer.prototype.output = function(src) { // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); + out += this.renderer.em(this.output(cap[2] || cap[1]), cap.input); continue; } From c1f919eb8208016f1e086961f9381efcb63149b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 5 Sep 2019 10:18:00 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/Fileslistitem.js | 5 +++-- .../react/src/modules/courses/coursesPublic/Showoldfiles.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index b06ab3dc1..4e8e89567 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -30,7 +30,8 @@ class Fileslistitem extends Component{ showfiles=(list)=>{ if(list.is_history_file===false){ // this.props.DownloadFileA(list.title,list.url) - window.location.href=list.url; + //window.location.href=list.url; + window.open(list.url, '_blank'); }else{ let {discussMessage,coursesId}=this.props let file_id=discussMessage.id @@ -49,7 +50,7 @@ class Fileslistitem extends Component{ // // } // this.props.DownloadFileA(result.data.title,result.data.url) - window.location.href=list.url; + window.open(list.url, '_blank'); }else{ this.setState({ Showoldfiles:true, diff --git a/public/react/src/modules/courses/coursesPublic/Showoldfiles.js b/public/react/src/modules/courses/coursesPublic/Showoldfiles.js index 693e3448b..cb054964e 100644 --- a/public/react/src/modules/courses/coursesPublic/Showoldfiles.js +++ b/public/react/src/modules/courses/coursesPublic/Showoldfiles.js @@ -178,7 +178,7 @@ class Showoldfiles extends Component{
"+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
"+text+"
\n"};Renderer.prototype.table=function(header,body){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?""+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); - -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ - -;(function() { - -/** - * Block-Level Grammar - */ - -var block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - nptable: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, - def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, - text: /^[^\n]+/ -}; - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); - -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') - ('def', '\\n+(?=' + block.def.source + ')') - (); - -block.blockquote = replace(block.blockquote) - ('def', block.def) - (); - -block._tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; - -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /
'
- + (escaped ? code : escape(code, true))
- + '\n
';
- }
-
- return ''
- + (escaped ? code : escape(code, true))
- + '\n
\n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
- return '\n' + quote + '\n'; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw) { - return '
' + text + '
\n'; -}; - -Renderer.prototype.table = function(header, body) { - return '' + text + '
';
-};
-
-Renderer.prototype.br = function() {
- return this.options.xhtml ? 'An error occured:
' - + escape(e.message + '', true) - + ''; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.defaults = { - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: false, - silent: false, - highlight: null, - langPrefix: 'lang-', - smartypants: false, - headerPrefix: '', - renderer: new Renderer, - xhtml: false -}; - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Renderer = Renderer; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -if (typeof module !== 'undefined' && typeof exports === 'object') { - module.exports = marked; -} else if (typeof define === 'function' && define.amd) { - define(function() { return marked; }); -} else { - this.marked = marked; -} - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); \ No newline at end of file +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
"+(escaped?code:escape(code,true))+"\n
"}return''+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"\n"+quote+"\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
"+text+"
\n"};Renderer.prototype.table=function(header,body){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?""+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); From 3657c075b11456ba1b531f355a5e3855d404137c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 5 Sep 2019 11:16:21 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTasksSubmitedit.js | 123 ++++++------------ .../graduation/tasks/GraduationTasksedit.js | 19 ++- 2 files changed, 56 insertions(+), 86 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index c527824c5..d5c6dd9c2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -2,7 +2,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Spin,Tooltip} from "antd"; import {Link} from 'react-router-dom'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -import { WordsBtn,getUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll} from 'educoder'; +import { WordsBtn,getUrl ,bytesToSize,getImageUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; const Search = Input.Search; @@ -49,13 +49,23 @@ class GraduationTasksSubmitedit extends Component{ if(result){ console.log(result.data.description); - + const fileList = result.data.attachments.map(item => { + return { + id: item.id, + uid: item.id, + name: appendFileSizeToUploadFile(item), + url: item.url, + filesize: item.filesize, + status: 'done' + } + }) this.setState({ workslist:result.data, attachments:result.data.attachments, selectmemberslist:result.data.members, selectobjct:result.data.members, description:result.data.description, + fileList:fileList }) if(result.data.task_type===1){ @@ -134,18 +144,7 @@ class GraduationTasksSubmitedit extends Component{ } } - onAttachmentRemoves = (file) => { - if(!file.percent || file.percent == 100){ - this.setState({ - Modalstype:true, - Modalstopval:'确定要删除这个附件吗?', - ModalSave: ()=>this.deleteAttachments(file), - ModalCancel:this.cancelAttachment - }) - return false; - } - } cancelAttachment=()=>{ this.setState({ Modalstype:false, @@ -155,49 +154,7 @@ class GraduationTasksSubmitedit extends Component{ }) } - deleteAttachments = (id) => { - - let {attachments,fileList}=this.state; - - const url = `/attachments/${id}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - // const { status } = response.data; - if (response.data.status === 0) { - console.log('--- success') - let newattachments=attachments; - - for(var i=0; i