common-window-javascript.md 2.27 KB
Newer Older
1 2
### 窗口级通用方法
#### 打开功能窗口
3 4
>Hel.openMenuWindow(opts);
 其中参数为:
5

6 7 8 9 10 11 12 13 14 15
属性名 | 类型 | 含义
-------- | ----- | -----
menuCode | String(必填) | 菜单代码
title | String(必填) | 窗口描述
url | Object(必填) | 窗口地址
menuName | String| 菜单名称
moduleFlag| String | 模块标志(Y/N)
documentKey| String | 打开同一个功能时,识别不同单据的唯一标识
reflashFlag| String | 关闭该功能菜单时是否刷新父级标志(Y/N)
moduleName| String | 模块名称
16 17
```
Hel.openMenuWindow({
18
    menuCode:'',//传入相应的参数
19 20 21 22 23 24 25 26 27 28
    title:'', 
    url:'', 
    menuName:'', 
    moduleFlag:'',
    documentKey:'', 
    reflashFlag:'',
    moduleName:''
});
```
 
29
#### 关闭功能窗口
30 31
>Hel.closeMenuWindow(opts);
其中参数为:
32

33 34 35
属性名 | 类型 | 含义
-------- | ----- | -----
menuCode | String(必填) | 菜单代码
36 37
```
Hel.closeMenuWindow({
38
  menuCode:''//传入相应的参数
39 40 41
});
```

42
#### 打开右弹窗口
43 44
>Hel.openBarWindow(opts);
其中参数为:
45 46 47 48 49 50

属性名 | 类型 | 含义
-------- | ----- | -----
id| String(必填) | 打开窗口的div的id
url| String(必填) | 窗口的url地址
size| String(必填) | 右弹窗口的宽度(THIRD/HALF/FULL/任意px像素)
51 52 53 54 55 56 57 58 59 60 61
```
 <div id="win"></div>
 <script><![CDATA[
    Hel.openBarWindow({
       id:'win',
       content:'',
       size:''
    });
 ]]></script>
```

62 63 64



65
#### 打开抽屉
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
> Hel.openBox()函数接收一个对象,对象属性含义如下:


属性名   | 类型  |  含义
-------- | ----- | -----
winId    | String(必填) | html元素标签的id
functionCode | String(必填) | 抽屉的唯一标识,用以确定该抽屉的相关信息
params | Object | 需传递的参数,将自动拼到url上
closeFunction | function | 关闭抽屉调用的方法
width | Number | 自定义宽度

```javascript

function test(e){
    ...    
}

Hel.openBox({
    winId:"domId",
    functionCode:"CSH200B",
    params:{
        contractId:1327,
        conContractCashflowId:4321
    },
    closeFunction:test,
    width:900
});

```
95
##### 注意: 
96 97 98 99 100 101 102
> - winId和functionCode必须有字符串类型的值
> - params可以没有,表示不拼接条件;
> - closeFunction可以没有,表示关闭抽屉不进行操作
> - width可以没有,表示使用配置的宽度



103