Foxtable(狐表)用户栏目专家坐堂 → AddCheckGroup模糊查询问题


  共有3228人关注过本帖树形打印复制链接

主题:AddCheckGroup模糊查询问题

帅哥哟,离线,有人找我吗?
leiguohui
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
AddCheckGroup模糊查询问题  发帖心情 Post By:2020/10/7 12:06:00 [显示全部帖子]

各位老师:
AddCheckGroup复选框可以做模糊查询的吗
类似下面的增加一个模糊查询功能
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=132228&authorid=0&page=0&star=1

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/7 17:00:00 [显示全部帖子]

蓝老师:这个我会,就是同一个网页不知道参数怎么传递

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/7 17:08:00 [显示全部帖子]

Select Case e.Path
Case "test.htm", ""
Dim wb As New WeUI
With wb.AddInputGroup("","ipg1","项目成员")
 With .AddInputCell("审核人") '通过InputCell增加输入框
                    .AddLabel("姓名","姓名",0) '增加标签,0显示在左边
                    
                    .AddInput("姓名","Text",1).Placeholder = "可手动输入,以" & "/" & " 隔开"
                    .AddVcodeButton("hym","模糊输入",2).Attribute = "" '调用js函数

                    
                End With

.AddInput("需求审核人","姓名","Text")
End With

Dim wb21 As New weui
wb21.AddForm("","form3","test.htm")
wb21.InsertHTML("form3","<div id='div12' style='overflow-y:auto;height:300px'>")
'''
Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")    ‘这个参数不会传,通过上面的姓名输入框
txt = "'%" & txt & "%'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
'''
With wb21.AddCheckGroup("form3","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i))
Next
End With
wb21.InsertHTML("form3","</div>")
'''
With wb.AddDialog("","dlg2", "请选择",wb21.Build)
'''
.AddButton("btnCancel11","取消").Kind = 1
Dim str As String = ""
str &= "var s = '';"
For i As Integer = 0 To ds1-1
str &= "var c" & i & " = document.getElementById('bm1" & i & "').checked;"
str &= "if(c" & i & "){s = s + '," & ary12(i) & "'};"
'''
Next
str &= "需求审核人.value = s.substring(1)"
.AddButton("btnOK11","确定").Attribute=" & str & """"
'''
'''
'''
End With
wb.AppendHTML("<script src='./lib/z.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页


 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/7 17:27:00 [显示全部帖子]

那复选框可以根据点击先后顺序写入到输入框吗

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/8 21:13:00 [显示全部帖子]

 蓝老师:
 第一步明白了,(如果能用Dialog就好了) 
 第二部选择复选框,内容填写回"需求审核人" 输入框,不会写、能麻烦您帮忙教下吗

http:
Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","tongji.htm")
        With wb.AddInputGroup("form1","ipg1","销售统计")
.AddInput("姓名","姓名模糊查询","Text")
.AddInput("需求审核人","姓名选择","Text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "统计", "button").Attribute= ""
        End With
        wb.AppendHTML("<div id='p1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的页面
        wb.AppendHTML("<script src='./lib/tj3.js'></script>") '引入脚本文件
        e.WriteString(wb.Build)

    Case "tongji.htm"
        Dim wb As New weui
            Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")
txt = "'%" & txt & "%'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
With wb.AddCheckGroup("","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i))
Next
End With
e.WriteString(wb.Build) 


JS:

function tongji2(){
    var result = submitAjaxForm('form1','',false);
    document.getElementById("p1").innerHTML=result;
}








[此贴子已经被作者于2020/10/8 21:13:01编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/11 15:10:00 [显示全部帖子]

蓝老师:好像没反应 ,是我写错了吗





Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","tongji.htm")
        With wb.AddInputGroup("form1","ipg1","销售统计")
.AddInput("姓名","姓名模糊查询","Text")
.AddInput("需求审核人","姓名选择","Text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "统计", "button").Attribute= ""
        End With
        wb.AppendHTML("<div id='p1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的页面
        wb.AppendHTML("<script src='./lib/tj3.js'></script>") '引入脚本文件
        wb.AppendHTML("<script src='./lib/tj4.js'></script>") '引入脚本文件
        e.WriteString(wb.Build)

    Case "tongji.htm"
        Dim wb As New weui
            Dim lk As String = Nothing
Dim txt As String = e.PostValues("姓名")
txt = "'%" & txt & "%'"
Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ds1 As Integer =DataTables("员工资料").SQLCompute("Count([姓名])","openid <> '" &  lk  & "'and 姓名 like " &  txt )
Dim ary11 As String=  String.Join("|",gjs11.ToArray)
Dim ary12() As String
ary12 = ary11.split("|")
With wb.AddCheckGroup("","rdg12","浏览器")
For i As Integer = 0 To ds1-1
.Add("bm1" & i, ary12(i)).Attribute = ""
Next
End With
e.WriteString(wb.Build) 


JS1:

function tongji2(){
    var result = submitAjaxForm('form1','',false);
    document.getElementById("p1").innerHTML=result;
}


JS2:

function tongji4(){
   document.getElementById("需求审核人").value=document.getElementById("需求审核人").value + ',' + v;
}

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/12 12:28:00 [显示全部帖子]

谢谢蓝老师,现在可以了!
蓝老师:
还有个问题,选择时增加,取消选择时就从输入框删除,怎么写(现在,取消/选择都会写入输入框)

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/12 15:43:00 [显示全部帖子]

厉害!可以了  谢谢蓝老师!
下面这个:AddDialog为什么关闭不了,是我写的有问题吗。老师帮忙看看!



    Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","tongji.htm")
        With wb.AddInputGroup("form1","ipg1","销售统计")
With .AddInputCell("姓名") '通过InputCell增加输入框
.AddLabel("姓名","姓名",0) '增加标签,0显示在左边
.AddInput("姓名","Text",1).Placeholder = "可手动输入,以" & "/" & " 隔开"
.AddVcodeButton("hym","模糊输入",2).Attribute = "" '调用js函数
End With
            .AddInput("姓名","姓名","Text").Attribute = "
            .AddInput("需求审核人","姓名","Text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "统计", "button").Attribute= ""
            .Add("btn11", "统计1", "button").Attribute= ""     
        End With
        wb.AppendHTML("<div id='p1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的页面
        wb.AppendHTML("<script src='./lib/tj3.js'></script>") '引入脚本文件
        wb.AppendHTML("<script src='./lib/tj4.js'></script>") '引入脚本文件
        e.WriteString(wb.Build)
        
    Case "tongji.htm"
        Dim wb As New weui
Dim wb2 As New weui
        Dim lk As String = Nothing
        Dim txt As String = e.PostValues("姓名")
        txt = "'%" & txt & "%'"
        Dim gjs11 As List(of String) = DataTables("员工资料").SQLGetValues("姓名","openid <> '" &  lk  & "'and 姓名 like " &  txt )
        Dim ary11 As String=  String.Join("|",gjs11.ToArray)
        Dim ary12() As String
        ary12 = ary11.split("|")
 wb2.InsertHTML("form1","<div id='div1' style='overflow-y:auto;height:300px'>")
        With wb2.AddCheckGroup("","rdg12","浏览器")
            For i As Integer = 0 To ary12.length-1
            .Add("bm1" & i, ary12(i)).Attribute = ""
            Next
        End With
wb2.InsertHTML("form1","</div>")
With wb.AddDialog("","dlg2", "请选择",wb2.Build)
            .AddButton("btnOK","确定")
.AddButton("btnOK11","确定").Attribute=""
        
            End With
        wb.AppendHTML("<script src='./lib/tj4.js'></script>") '引入脚本文件
        
        e.WriteString(wb.Build) '返回增加成功消息
     

js1
function tongji2(){
    var result = submitAjaxForm('form1','',false);
    document.getElementById("p1").innerHTML=result;
show('dlg2')
}

[此贴子已经被作者于2020/10/12 15:50:21编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/12 16:19:00 [显示全部帖子]

蓝老师:没有这句好像,显示出来的不是筛选的内容

wb.AddDialog("","dlg2", "请选择",wb2.Build)

 回到顶部
帅哥哟,离线,有人找我吗?
leiguohui
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:78 积分:769 威望:0 精华:0 注册:2017/5/22 10:51:00
  发帖心情 Post By:2020/10/12 16:52:00 [显示全部帖子]

蓝老师:好像不可以,打开没有筛选数据-只有两个按钮
[此贴子已经被作者于2020/10/12 16:53:47编辑过]

 回到顶部
总数 17 1 2 下一页