1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangyi2652 $
$Date: 2010/11/30 06:19:07 $
$Revision: 1.2 $
$Purpose: 角色分配功能
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:view>
<a:link id="sys_role_function_link" url="${/request/@context_path}/modules/sys/public/sys_role_function.lsc"/>
<script type="text/javascript"><![CDATA[
function close() {
$('assign_function').close();
}
function save() {
var role_id='${/parameter/@role_id}';
var ds = $('function_tree_ds');
var records=ds.getAll();
var array=[];
var n=0;
for (var i=0,j=records.length;i<j;i++)
{
var record=records[i];
if(record.get('checked')=='Y')
{
array[n]={
role_id:role_id,
function_id:record.get('function_id'),
sequence:record.get('sequence'),
expanded:record.get('expanded'),
checked:record.get('checked')
};
n++;
}
}
var data={};
data['functions']=array;
data['role_id']=role_id;
Leaf.request({
url: $('sys_role_function_link').getUrl(),
para: data,
success: function (res) {
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
},
scope: this
});
}
function expandEditorFunction(record, name) {
if (record.get('function_type') == 'G') {
return 'grid_cb';
} else {
return '';
}
}
]]></script>
<a:dataSets>
<a:dataSet id="function_tree_ds" autoCount="false" autoQuery="true" fetchAll="true" model="sys.sys_role_function_view" queryUrl="${/request/@context_path}/autocrud/sys.sys_role_function_view/query?role_id=${/parameter/@role_id}">
<a:fields>
<a:field name="function_code" readOnly="true"/>
<a:field name="function_name" readOnly="true"/>
<a:field name="expanded" checkedValue="Y" uncheckedValue="N"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton click="save" text="HLS.SAVE"/>
<a:gridButton click="close" text="HLS.CLOSE"/>
</a:screenTopToolbar>
<a:treeGrid id="functionTreeGrid" bindTarget="function_tree_ds" expandField="_expanded" height="530" idField="function_id" parentField="parent_function_id" showCheckBox="true" width="570">
<a:columns>
<a:column name="function_name" width="250"/>
<a:column name="function_code" width="120"/>
<a:column name="expanded" editorFunction="expandEditorFunction" width="80"/>
<a:column name="sequence" align="right" editor="grid_nf" width="100"/>
</a:columns>
<a:editors>
<a:numberField id="grid_nf"/>
<a:checkBox id="grid_cb"/>
</a:editors>
</a:treeGrid>
</a:screenBody>
</a:view>
</a:screen>