- 注册时间
- 2021-6-29
- 最后登录
- 2023-12-12
- 阅读权限
- 10
- 积分
- 54
- 精华
- 0
- 帖子
- 9
|
本帖最后由 guatianshuileng 于 2023-11-27 17:18 编辑
tabs添加并打开一个tab时,tabload事件会重复触发,触发次数是历史打开次数,请问是什么原因,代码如下:- function openHistData(data) {
- let row = grid.getSelected();
- let tabs = window.parent.tabs;
- //打开参数补录页面
- let url = RootPath() + "/prod_operation_data.html";
- if (tabs) {
- let tab = {
- name: 'prodOprationTab',
- title: '参数录入',
- url: url,
- iconCls: 'fa fa-file-text-o',
- showCloseButton: true
- };
- if (tabs.getTab(tab.name)){
- tabs.removeTab(tab.name);
- }
- tab = tabs.addTab(tab);
- tabs.activeTab(tab);
- //tabload事件会被触发多次
- tabs.on("tabload",function(e){
-
- let tab=e.tab;
- var iframe=tabs.getTabIFrameEl(tab);
-
- let row = grid.getSelected();
- let orgId = row.ORG_ID;
- let stationId = row.STATION_ID;
- let dateReport = row.DATE_REPORT;
- let bcCode = row.BC_NAME;
- //跨页面调用tab里面新页面的方法,传参数过去
- iframe.contentWindow.openTab(orgId, stationId, dateReport, bcCode)
- });
- } else {
- window.open(url, "_blank")
- }
- }
复制代码
|
|