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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zsy
$Date: 2018/11/14
$Revision: 1.0
常用链接 微件
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure/>
<a:view template="default" package="leaf.ui.std">
<style>
html,body{
width:220px;
height:249px;
margin: 0;
padding: 0;
color:#000;
}
.widget_hot_link{
box-sizing:border-box;
width:220px;
height:249px;
background-color:#fff;
position:relative;
border:1px solid #F0F0F3;
user-select:none;
cursor:default;
}
.widget_hot_link .widget_label{
position:absolute;
width:40px;
height:4px;
top:0;
left:16px;
background-color:#5A7FFF;
}
.widget_hot_link .widget_title{
box-sizing:border-box;
position:relative;
height:20px;
line-height:20px;
margin:16px 0 10px 0;
font-family: PingFangSC-Medium;
font-size: 14px;
padding:0 24px 0 16px;
color: rgba(75,80,90,0.85);
letter-spacing: 0;
}
.widget_hot_link .widget_content{
box-sizing:border-box;
width:100%;
height:205px;
border-top:1px solid #EDEDED;
padding:4px 15px;
}
.widget_hot_link .widget_content .link{
display: block;
width:100%;
height:20px;
margin-top:12px;
text-decoration:none;
}
.widget_hot_link .widget_content .link:visited,
.widget_hot_link .widget_content .link:hover,
.widget_hot_link .widget_content .link:active{
text-decoration:none;
color: rgba(75,80,90,0.85);
}
.widget_hot_link .widget_content .link .icon{
width:20px;
height:20px;
}
.widget_hot_link .widget_content .link .link_info{
font-family: PingFangSC-Regular;
font-size: 12px;
color: rgba(75,80,90,0.85);
line-height: 20px;
vertical-align:top;
padding-left:0.3em;
max-width: 150px;
white-space: nowrap;
overflow: hidden;
display: inline-block;
text-overflow: ellipsis;
}
</style>
<script><![CDATA[
$L.onReady(function(){
var ds = $("widget_sys_hot_link_ds");
ds.qpara={
enable_flag:'Y'
};
ds.query();
});
function onLoad_widget_sys_hot_link_ds(ds){
var htmlStr = '';
var records = ds.getAll();
var wrapper = jQuery(".widget_hot_link .widget_content");
for(var i=0;i<records.length;i++){
var addr = records[i].get("common_link_address");
var reg=/(file:\/\/\/)|(FTP:\/\/)|(HTTP:\/\/)|(HTTPS:\/\/)|(mailto:)|(MMS:\/\/)|(ed2k:\/\/)|(Flashget:\/\/)|(thunder:\/\/)/i;
if(!reg.test(addr)){
addr = 'http://' + addr;
}
htmlStr += '<a class="link" target="_blank" href="' +addr+ '">'
+'<img class="icon" src="${/request/@context_path}/leafresource/images/widget/link.png"/>'
+'<span class="link_info">' +records[i].get("common_link_name")+ '</span>'
+'</a>';
}
wrapper.html(htmlStr);
}
]]></script>
<a:dataSets>
<a:dataSet id="widget_sys_hot_link_ds" model="sys.SYS002.hls_sys_common_links"
autoQuery="false" pageSize="5" fetchAll="false">
<a:fields>
<a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="Y"/>
<a:field name="common_link_name"/>
<a:field name="common_link_address"/>
</a:fields>
<a:events>
<a:event name="load" handler="onLoad_widget_sys_hot_link_ds"/>
</a:events>
</a:dataSet>
</a:dataSets>
<div class="widget_hot_link">
<span class="widget_label"> </span>
<div class="widget_title">常用链接</div>
<div class="widget_content"> </div>
</div>
</a:view>
</a:screen>