以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 照片上传失败 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=115753) |
-- 作者:yifan3429 -- 发布时间:2018/3/13 20:51:00 -- 照片上传失败 照片上传失败 可以加入选择吗 直接拍照还是选择文件上传 Dim e As RequestEventArgs = args(0) Dim wb As New WeUI \'定义一个基于weui框架的网页生成器 Select Case e.Path Case "qyrzfj.htm" Dim bm As String Dim gw As String Dim name As String Dim userid = Functions.Execute("验证函数",e,"qyrzfj.htm") If userid > "" Then wb.AppendCookie("userid",userid) \'将用户名和密码写入cookie Dim wxdr As DataRow = DataTables("users").SQLFind("userid=\'" & userid & "\'") If wxdr IsNot Nothing Then gw = wxdr("position") name = wxdr("name") Dim wxdr1 As DataRow = DataTables("departments").SQLFind("id=\'" & wxdr("department") & "\'") If wxdr1 IsNot Nothing Then bm= wxdr1("name") End If \'e.WriteString(name & userid & "USERID获取成功" & gw & bm) \'------------------------------------------------------------------------------------------------------------------------------ wb.AddPageTitle("","pageheader","工作日志","艾迪尔国际家居") If e.PostValues.Count = 0 Then wb.AddForm("","form1","qyrz.htm") With wb.AddInputGroup("form1","ipg1","") With .AddInput("姓名","填报人","Text") .value = name .readonly = True End With With .AddInput("部门","所属部门","Text") .value = bm .readonly = True End With With .AddInput("岗位","岗位","Text") .value = gw .readonly = True End With \'提取登陆数据 End With With wb.AddInputGroup("form1","ipg2","日志内容") With .AddInput("日期","填报日期*","date") .Value = Date.Today End With .AddInput("汇报对象","汇报对象*","Text") With wb.AddInputGroup("form1","ipg3","今日达成") .AddTextArea("今日达成",5).Placeholder = "请输入您的今日达成的工作 * " End With With wb.AddInputGroup("form1","ipg4","明日计划") .AddTextArea("明日计划",5).Placeholder = "请输入您的明日计划工作 * " End With .AddInput("营业收入","业绩收入","number") .AddInput("今日支出","今日支出","number") With wb.AddInputGroup("form1","ipg5","领导协助事项") .AddTextArea("工作建议",5).Placeholder = "请输入您需要上级协助的事情,或是需要提醒您的上级的待办事项." End With With wb.AddInputGroup("form1","ipg6","文件上传") With .AddUploader("up128","照片",True) .AllowDelete = True \'允许删除 .Incremental = True \'允许 重复选择文件或连续拍照 End With End With With wb.AddInputGroup("form1","ipg7","重要资料请 tocasa@icwood.top 邮箱") \'.AddUploader("up1","客户资料",True) \'True表示允许上传多个文件 End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "button").Attribute= "" \'调用js函数上传 End With wb.AddToast("","tst1", "正在上传",1) wb.AddToast("","tst2", "上传成功",0) wb.AddToast("","tst3", "上传失败",0).Icon= "warn" wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) \'生成网页 \'Case "qyrzfj.htm" For Each key As String In e.Files.Keys For Each fln As String In e.Files(key) e.SaveFile(key,fln,"d:\\web\\uploadfiles\\" & fln) \'保存接收到的文件 Next Next e.WriteString("OK") \'e.WriteString(wb.Build) End With Else Dim nms() As String = {"今日达成","明日计划","日期","姓名","部门","岗位","汇报对象" } \'不能为空的列名数组 For Each nm As String In nms If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页 With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!") .icon = "Warn" \'改变图标 .AddButton("btn1","返回").Attribute = "" End With e.WriteString(wb.Build) Return "" \'必须返回 End If Next nms = New String() {"今日达成","明日计划","日期","姓名","营业收入","工作建议","今日支出" ,"部门","岗位"} \'重新定义了nms数组,增加了两列. Dim dr As DataRow = DataTables("工作日报").AddNew() For Each nm As String In nms If e.PostValues.ContainsKey(nm) Then dr(nm) = e.PostValues(nm) End If Next dr.save() wb.InsertHTML("我们收到您的日志:<br/>") For Each key As String In e.PostValues.Keys wb.InsertHTML(key & ":" & e.PostValues(key) & "<br/>") Next With wb.AddMsgPage("","msgpage","提交成功", "感谢您的付出,公司的辉煌离不开您的付出") \'生成成功提示页 .AddButton("btn1","查看历史","lsrz.htm") End With e.WriteString(wb.Build) End If \'----------------------------------------------------------------------------------- End If End If End Select
|
-- 作者:有点蓝 -- 发布时间:2018/3/13 21:24:00 -- 接收文件参考:http://www.foxtable.com/mobilehelp/scr/0060.htm |
-- 作者:yifan3429 -- 发布时间:2018/3/14 17:43:00 -- 两个问题不能解决 1.图片不能上传多个 只能一张. 2.图片上传不到服务器,不显示增加成功界面 直接调回zpcs.htm \'------------------------------------------------------------------------------------------------------------------------------ wb.AddForm("","form1","zpcs.htm") With wb.AddInputGroup("form1","ipg1","增加员工") .AddInput("姓名","姓名","Text") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddUploader("up1","照片",True) \'True表示允许上传多个文件 End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With e.WriteString(wb.Build) Else Dim nms() As String = {"姓名"} Dim dr As DataRow = DataTables("设计师档案").AddNew() For Each nm As String In nms dr(nm) = e.PostValues(nm) Next For Each key As String In e.Files.Keys If key = "up1" Then For Each fln As String In e.Files(key) e.SaveFile(key, fln,"C:\\web\\images\\shejishida" & fln) Next dr.Lines("照片") = e.Files(key) End If Next \'保存并生成增加成功提示页面 dr.save() With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") \'生成成功提示页 .AddButton("btn1","继续增加","zpcs.htm") End With e.WriteString(wb.Build) \'----------------------------------------------------------------------------------- End If End If End Select
|
-- 作者:有点甜 -- 发布时间:2018/3/14 18:49:00 -- 参考这个做法
http://www.foxtable.com/mobilehelp/scr/0106.htm
http://www.foxtable.com/mobilehelp/scr/0251.htm
http://www.foxtable.com/mobilehelp/scr/0139.htm
|