From 859caa18b9620df7b739e3207f1b30174829b035 Mon Sep 17 00:00:00 2001 From: yangjian Date: Thu, 25 Feb 2021 21:18:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=96=B0=E5=BB=BA=E6=96=87?= =?UTF-8?q?=E9=9B=86=E5=BC=B9=E5=87=BA=E6=A1=86=E6=94=AF=E6=8C=81=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=B7=B3=E8=BD=AC=E6=96=B0=E5=BB=BA=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/app_doc/pro_list.html | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/template/app_doc/pro_list.html b/template/app_doc/pro_list.html index 5b4b2fc..3329470 100644 --- a/template/app_doc/pro_list.html +++ b/template/app_doc/pro_list.html @@ -323,7 +323,7 @@ area:'400px;', id:'createPro',//配置ID content: $('#create-project-div'), - btn:['{% trans "确定" %}','{% trans "取消" %}'], //添加按钮 + btn:['{% trans "确定" %}','{% trans "创建并添加文档" %}','{% trans "取消" %}'], //添加按钮 btnAlign:'c', //按钮居中 sucess:function(){ form.render(); @@ -356,6 +356,34 @@ } }) }, + btn2:function(index,layero) { + layer.load(1) + data = { + 'picon':$("#picon").val(), + 'pname':$("#pname").val(), + 'desc':$("#desc").val(), + 'role':$("input[name=project-role]:checked").val(), + } + $.ajax({ + url:"{% url 'create_project' %}", + type:'post', + data:data, + success:function(r){ + if(r.status){ + window.location.href = '/create_doc/?pid=' + r.data.id; + }else{ + //创建失败,提示 + console.log(r) + layer.closeAll('loading') + layer.msg(r.data) + } + }, + error:function(){ + layer.closeAll('loading') + layer.msg("创建异常") + } + }) + }, }); }; //修改文集