找回密码
 注册成为天翎用户
查看: 277|回复: 1

[已解决] app隐藏这样写对吗?

[复制链接]
lillian828 发表于 2021-6-22 18:39:05 | 显示全部楼层 |阅读模式
【myApps/OBPM版本号】:v4.4- sp21
【浏览器类型】:Chrome/
【联系方式-QQ】:
【联系电话】:   
【问题描述】:

问:app隐藏这样写对吗?

(function(){     
    var doc=getCurrentDocument();      
    var zt=getItemValueAsString("status");     
    var html = "";     
    if("未提交".equals(zt)){         
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden='zg;ys'&#160;documentshow='pc'></o-action>";
&#160;&#160;&#160;&#160;}else&#160;if("待整改".equals(zt)){&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden='ys'&#160;documentshow='pc;zg'></o-action>";
&#160;&#160;&#160;&#160;}else{&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden=''&#160;documentshow='pc;zg;ys'></o-action>";
&#160;&#160;&#160;&#160;}&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;return&#160;html;&#160;&#160;&#160;&#160;&#160;
})();


答:documentshow='pc;zg;ys'> 让你传入的是控件id,你自己写的id属性吗?如果是那没用, 你自己设置的在手机端是没有的


问:是的,那如果要隐藏的字段比较多就要一个个写吗?那有没有方法判断是app端还是网页端?

答:是的,有的,可参考 https://blog.csdn.net/qq_33645580/article/details/107814812


问:换成本身有的id貌似没生效

(function(){&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;var&#160;doc=getCurrentDocument();&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;var&#160;zt=getItemValueAsString("status");&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;var&#160;html&#160;=&#160;"";&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;if("未提交".equals(zt)){&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden='__2rE0CvVU5m7eYDudzfy'&#160;documentshow=''></o-action>";
&#160;&#160;&#160;&#160;}else&#160;if("待整改".equals(zt)){&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden=''&#160;documentshow=''></o-action>";
&#160;&#160;&#160;&#160;}else{&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;html&#160;+=&#160;"<o-action&#160;action-type='documentshowhidden'&#160;documenthidden=''&#160;documentshow=''></o-action>";
&#160;&#160;&#160;&#160;}&#160;&#160;&#160;
&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;return&#160;html;&#160;&#160;&#160;&#160;&#160;
})();


1.png
 楼主| lillian828 发表于 2021-6-22 18:40:56 | 显示全部楼层
答:你要更新的,这个方法是在后面加的。
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 01:01

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表