泛微E9开发 查询页面添加按钮,完成特定功能

查询页面添加按钮,完成特定功能

1、关联知识(查询页面实现新增按钮)

泛微E9开发 如何在查询页面新增按钮,通过按钮新建指定流程

2、功能实现

2.1. 点击按钮,输出选中的checkbox的值

javascript 复制代码
 	var a=_xtable_CheckedCheckboxId();
    var ids = ModeList.getCheckedID();
    var detailDws = ModeList.getCheckedIDWithDetail();
    console.log(`a=${a}`);
    console.log(`ids=${ids}`);
    console.log(`detailDws=${detailDws}`);

控制台输出

2.2. 点击按钮,打开一个自定义对话框

javascript 复制代码
 	//此方法用来打开一个自定义对话框
    //如果是内部iframe里定义的方法,直接写方法名,外部添加代码块方式添加的方法,需要在方法名前面加上base.
    let buttons=[{btnname:'保存',callfun:'base.saveDialog'},
                {btnname:'新建',callfun:'base.add'},
                {btnname:'关闭',callfun:'base.closeDialog'}];
    let style={width:300,height:600};
    let prop={title:'测试jsp',url:'',style:style};
    ModeForm.openCustomDialog(prop,buttons)

自定义对话框样式

3、实现方法

  1. 通过【后端】-【建模引擎】-【模块】,找到模块后,选择【页面扩展】,新建一个页面扩展
  2. 设置好页面扩展内容后,保存。
  3. 找到该模块对应的查询界面,插入以下代码块。
javascript 复制代码
<script type="text/javascript">
  
  function saveDialog(){
    console.log("saveDialog");
  }
  
  function add(){
    console.log("add");
  }

  function closeDialog(){
    console.log("closeDialog");
    parent.ModeForm.closeCustomDialog();   //此方法用来关闭一个自定义对话框
  }
  
  function onTest(){
    var a=_xtable_CheckedCheckboxId();
    var ids = ModeList.getCheckedID();
    var detailDws = ModeList.getCheckedIDWithDetail();
    console.log(`a=${a}`);
    console.log(`ids=${ids}`);
    console.log(`detailDws=${detailDws}`);
    
    //此方法用来打开一个自定义对话框
    //如果是内部iframe里定义的方法,直接写方法名,外部添加代码块方式添加的方法,需要在方法名前面加上base.
    let buttons=[{btnname:'保存',callfun:'base.saveDialog'},
                {btnname:'新建',callfun:'base.add'},
                {btnname:'关闭',callfun:'base.closeDialog'}];
    let style={width:300,height:600};
    let prop={title:'测试jsp',url:'',style:style};
    ModeForm.openCustomDialog(prop,buttons)
  }

</script>
相关推荐
欣欣之王来了16 小时前
原始HTML插值:v-html指令的使用与安全风险
前端·学习·架构·项目·vue3教程
IT_陈寒16 小时前
Redis的LRU淘汰策略坑了我一整天
前端·人工智能·后端
计算机魔术师17 小时前
砍半价格、参数再涨,国产旗舰追到 Opus 鼻尖了
前端
特立独行的猫A17 小时前
10 MB 的桌面 AI 客户端:用仓颉 + 系统 WebView 替代 Electron
前端·harmonyos
小成2023032026517 小时前
C++~07补充
开发语言·c++
修炼的dance18 小时前
白底图存JPG,sharp开mozjpeg背景杂点少近三成
前端
anOnion18 小时前
构建无障碍组件之Grid Pattern
前端·html·交互设计
乔旭伟18 小时前
Vben3 中后台表格封装实战:useVbenVxeGrid 的全局收敛与七个坑
前端·anti-design-vue·1024程序员节
鶴哥只手遮天18 小时前
jQuery 4.0 源码架构与工程实践-第 10 章 尺寸、几何与显隐
前端·javascript·jquery