以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  Ajax后端运行的时候,怎么在前端进行状态提醒呢?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=178207)

--  作者:cnsjroom
--  发布时间:2022/6/23 11:26:00
--  Ajax后端运行的时候,怎么在前端进行状态提醒呢?
Ajax后端运行的时候,怎么在前端进行状态提醒呢?
因后端生成文件需要时间,用户点击前端按钮后,想提示转圈或者状态提醒字样,待文件生成后,直接打开文件
前后端代码该怎么完善呢?

后端代码:
Public Sub form289_word_Aj ax(rq as Request) 
Dim e As RequestEventArgs = rq.e
Dim cmd As SQLC ommand = rq.cmd
Dim time As String =Format(Date.now,"yyyyMMddHHmmss") 
Dim tm As String  = ProjectPath & "Attachments\\谈话通知书.doc" \'指定模板文件
Dim f1 As String = ProjectPath & "Reports\\谈话通知书"& e.Values("创建人") & e.Values("guid") & time &".doc" \'指定目标文件
Dim f2 As String = ProjectPath & "Reports\\谈话通知书"& e.Values("创建人") & e.Values("guid") & time &".pdf" \'指定目标PDF文件
Dim wrt As New WordReport(tm,f1)
wrt.AddDataTable("谈话措施台账","主数据源","Se lect * from {谈话措施台账} where guid = \'" & e.Values("guid") & "\' ")
wrt.Build() 
wrt.SaveToPDF(f2) \'保存为PDF文件
wrt.Quit() \'退出
\'返回生产的报表路径
e.WriteString("\\Reports\\谈话通知书"& e.Values("创建人") & e.Values("guid") & time &".pdf")
End Sub

前端代码:
({
    button6: {
        text: \'{{text}}\', //系统自动匹配标题
        visible:true,
        click: fun ction () { //按钮单击事件
        var data = {};//返回参数到前端
$.p ost("form289_word.Ajax",{guid:e.form.guid,创建人:e.form.user.name},function(res){ 
    var a = document.createElement("a");
    a.setAttribute("href", myurl + res);
    a.setAttribute("target", "下载excel");
    docum ent.body.appendChild(a);
    a.click();
    a.remove();
})
        }
    }
})
[此贴子已经被作者于2022/6/23 11:26:56编辑过]

--  作者:有点蓝
--  发布时间:2022/6/23 11:35:00
--  
这个和后端没有关系。至于前端的话,自己去看看使用的框架的文档吧,我也不清楚