本文主要是介绍WabaCus实现列表操作列的多按钮执行操作(项目实战),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
写这篇博文的初衷:
官方提供的操作列按钮操作只有一个,即使放上多个按钮也只执行同一方法,往往不能满足实际工作中的需求,例如:
<col column="{editablelist-edit}" label="操作列" width="100px"><![CDATA[<input type="button" class='cls-button' value="修改时间"/>]]><![CDATA[<input type="button" class='cls-button' value="发送面试通知"/>]]>
</col>
此时,可借助<a></a>来完成,再设置成按钮的style即可,实例如下:
<report id="report2" title="面试沟通中信息" parenttitle="沟通中request{c1}" rowselect="checkbox" type="editablelist"><!-- getReportColData()是page引入的js中的方法,选择时进行拦截处理 --><buttons><button name="button1" position="title" label="放弃沟通">getReportColData('interview','report2',{c01:true},{name:'SELECTEDROW',value:true},'GiveUpCommunication');</button></buttons><display><col column="c1" label="个数" displaytype="hidden" /><col column="c01" label="co1" displaytype="hidden" clickorderby="true" valuestyleproperty="style='mso-number-format:\@' width='10%'"><inputbox jsvalidate="isNotEmpty(${invalid.isnotempty})"/></col><col column="c02" label="姓名"></col><col column="c03" label="应聘职位"></col><col column="c12" label="邀约面试官"></col><col column="c13" label="确认面试官" clickorderby="true" width="15%"></col><col column="c14" label="确认面试时间" width="160px"></col><col column="c15" label="面试通知"></col><col column="{non-fromdb}" label="操作" property="look" width="170px"></col></display><sql><select><value><![CDATA[select (SELECT COUNT(*) c FROM A05 a WHERE c10='沟通中') c1,c01,c02,c03,c12,c13,c14,c15 from A05 where {#condition#} and c10='沟通中']]></value><condition name="txtgonghao" label="姓名|职位"><value><![CDATA[(c02 like '%#data#%' or c03 like '%#data#%')]]></value><inputbox><typeprompt count="30"><promptcol label="c02" title="姓名" matchmode="anywhere"></promptcol><promptcol label="c03" title="应聘职位" matchmode="anywhere"></promptcol><datasource><option dataset="@{select c02,c03 from A05 where {#matchcondition#}}"></option></datasource></typeprompt></inputbox></condition><condition name="txtchosemsg" label="确认面试官"><value><![CDATA[(c13 =#data#)]]></value><inputbox type="selectbox"><option value="" label="确认面试官"></option><option value="待反馈" label="待反馈"></option><option value="已同意" label="已同意"></option><option value="已拒绝" label="已拒绝"></option></inputbox></condition></select></sql><format><imports><import>com.wabacus.util.*</import><import>com.java.util.*</import></imports><value>rrequest.getRequest().setAttribute("c1",c1); <!-- 存放request,以便显示标题时能取到 --><![CDATA[look = c13.indexOf("拒绝")==-1&&c13!="已拒绝"?(c13!="已拒绝"&&c14.indexOf("同意")!=-1?"<a style='line-height:21px;padding: 0 10px;background:#00B38A;border-radius:3px;display:inline-block;font-size:12px;text-decoration:none;color:white;' href='javascript:void(0)' onclick=\"wx_winpage('http://localhost:8080/OA/ShowReport.wx?PAGEID=CancelPlan&id="+c01+"',{width:'35%',height:'35%',title:'取消面试安排'})\">取消安排</a> <a style='line-height:21px;padding: 0 10px;background:#00B38A;border-radius:3px;display:inline-block;font-size:12px;text-decoration:none;color:white;' href='javascript:void(0)' onclick=\"wx_winpage('http://localhost:8080/OA/ShowReport.wx?PAGEID=ReachConfirm&id="+c01+"',{width:'50%',height:'50%',title:'确认应聘者已到达'})\">确认到达</a>":"<a style='line-height:21px;padding: 0 10px;background:#00B38A;border-radius:3px;display:inline-block;font-size:12px;text-decoration:none;color:white;' href='javascript:void(0)' onclick=\"wx_winpage('http://localhost:8080/OA/ShowReport.wx?PAGEID=UpdteInvitationsTime&id="+c01+"',{width:'35%',height:'35%',title:'面试沟通中'})\">修改时间</a> <a style='line-height:21px;padding: 0 10px;background:#00B38A;border-radius:3px;display:inline-block;font-size:12px;text-decoration:none;color:white;' href='javascript:void(0)' onclick=\"wx_winpage('http://localhost:8080/OA/ShowReport.wx?PAGEID=SendEmail&id="+c01+"',{width:'50%',height:'50%',title:'面试沟通中'})\">发送面试通知</a>"):"<a style='width:145px;line-height:21px;padding: 0 10px;background:#00B38A;border-radius:3px;display:inline-block;font-size:12px;text-decoration:none;color:white;' href='javascript:void(0)' onclick=\"wx_winpage('http://localhost:8080/OA/ShowReport.wx?PAGEID=TwoInvitations&id="+c01+"',{width:'35%',height:'35%',title:'重新发起邀约'})\">重新发起邀约</a>";c02 = "<a style='color:#3F00FF' href='ShowReport.wx?PAGEID=ViewWerPDF&c01="+c01+"'>"+c02+"</a>";]]></value></format>
</report>
亮点:
1、发挥三目运算符的优势,完成了对按钮的设定
2、点击姓名可实现在线文件预览(下期会有一篇博文专门来讲述,尽请期待。。。)
效果图:
这篇关于WabaCus实现列表操作列的多按钮执行操作(项目实战)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!