From 25a5f17474910377f30b758459d1200c06d01c43 Mon Sep 17 00:00:00 2001 From: XXAY <2606432452@qq.com> Date: Thu, 23 Sep 2021 12:22:36 +0800 Subject: [PATCH] tools --- templates/page/tools.html | 79 +++----------- templates/tools/blast.html | 143 +++++++------------------- templates/tools/genbank_to_fasta.html | 72 ++++++++----- 3 files changed, 105 insertions(+), 189 deletions(-) diff --git a/templates/page/tools.html b/templates/page/tools.html index a7cbbe5..f5e8f24 100644 --- a/templates/page/tools.html +++ b/templates/page/tools.html @@ -122,6 +122,7 @@ var $ = layui.jquery; var form = layui.form; var url_up = 'http://127.0.0.1:8000/' + var upload = layui.upload // 页面跳转加载函数 @@ -211,83 +212,35 @@ }); } - // 文件上传 - function up_file(tools_type, in_data) { + + // gen to fa + + + function gen_to_fa() { layui.use(['upload'], function () { var $ = layui.jquery - , upload = layui.upload - , element = layui.element , layer = layui.layer; - //选完文件后不自动上传["select_file1","select_file1","blast"], {} upload.render({ - elem: '#select_file1' - , url: url_up + 'tools/' + tools_type + elem: '#select_gen' + , url: url_up + 'tools/' + "gen_to_fa" , auto: false , accept: 'file' - , field: "file1" , data: { csrfmiddlewaretoken: '{{ csrf_token }}' - , file_type: 1 } - , bindAction: '#run' - , done: function (res) { - layer.msg('上传成功'); - console.log(res) + , bindAction: '#gen_to_fa_run' + , done: function (res, index, upload) { + layer.closeAll('loading'); //关闭loading } - }); + , error: function (index, upload) { + layer.closeAll('loading'); //关闭loading + } + }) + ; }) } - // 两文件上传 - function up_file_blast(tools_type, in_data) { - layui.use(['upload'], function () { - var $ = layui.jquery - , upload = layui.upload - , element = layui.element - , layer = layui.layer; - //选完文件后不自动上传 - upload.render({ - elem: '#select_file2' - , url: url_up + 'tools/blast' - , auto: false - , accept: 'file' - , field: "file2" - , data: { - csrfmiddlewaretoken: '{{ csrf_token }}' - , file_type: 2 - , type : $("#quiz1").val() - , e : $("#e").val() - } - , bindAction: '#run' - , done: function (res) { - layer.msg('上传成功'); - console.log(res) - } - }); - }) - - layui.use(['upload'], function () { - var $ = layui.jquery - , upload = layui.upload - , element = layui.element - , layer = layui.layer; - //选完文件后不自动上传 - upload.render({ - elem: '#select_file1' - , url: url_up + 'tools/tools' - , auto: false - , accept: 'file' - , field: "file1" - , data: {csrfmiddlewaretoken: '{{ csrf_token }}'} - , bindAction: '#id_transform_run' - , done: function (res) { - layer.msg('上传成功'); - console.log(res) - } - }); - }) - } diff --git a/templates/tools/blast.html b/templates/tools/blast.html index 515a173..82cecb0 100644 --- a/templates/tools/blast.html +++ b/templates/tools/blast.html @@ -1,24 +1,18 @@ -