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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分前端管理</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/icon.css">
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/locale/easyui-lang-{$language}.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDrag.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDialog.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/functions.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/md5.js"></script>
<link href="__PUBLIC__/newVsdn/css/style_frame.css?v=20190829" rel="stylesheet" type="text/css" />
</head>
<body>
<!--搜索和按钮 开始 -->
<div class="searchMedia clearfix">
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="hyperchanne clearfix">
<form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson">
<div class="inputBox">
<select class="select" name="searchSite">
<option value="0">请选择站点</option>
<volist name="site_lists" id="item">
<option value="{$item.id}" <if condition="$key eq 0">selected="selected"</if> >{$item.name}</option>
</volist>
</select>
<select class="select" name="searchClass">
<option value="0">请选择分类</option>
<option value="1">电竞</option>
<option value="2">电影</option>
</select>
<select class="select" name="searchType">
<option value="0">请选择类型</option>
<option value="绝地求生" pid="1" style="display: none">绝地求生</option>
<option value="我的世界" pid="1" style="display: none">我的世界</option>
<option value="英雄联盟" pid="1" style="display: none">英雄联盟</option>
<option value="王者荣耀" pid="1" style="display: none">王者荣耀</option>
<option value="火爆节目" pid="1" style="display: none">火爆节目</option>
<option value="游戏专区" pid="1" style="display: none">游戏专区</option>
<option value="明星主播" pid="1" style="display: none">明星主播</option>
<option value="电竞赛事" pid="1" style="display: none">电竞赛事</option>
<option value="游戏改编" pid="1" style="display: none">游戏改编</option>
<option value="网络电影" pid="2" style="display: none">网络电影</option>
<option value="免费大片" pid="2" style="display: none">免费大片</option>
<option value="亲子之旅" pid="2" style="display: none">亲子之旅</option>
<option value="文艺情感" pid="2" style="display: none">文艺情感</option>
<option value="警匪动作" pid="2" style="display: none">警匪动作</option>
<option value="恐怖悬疑" pid="2" style="display: none">恐怖悬疑</option>
<option value="新片预告" pid="2" style="display: none">新片预告</option>
<option value="科幻灾难" pid="2" style="display: none">科幻灾难</option>
<option value="战争史诗" pid="2" style="display: none">战争史诗</option>
</select>
<input class="input" type="text" placeholder="媒资名称/媒资唯一标识" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
</form>
</div><!--hyperchanne end-->
</div>
</div>
</div>
<!--搜索和按钮 结束-->
<table id="dg" title=""
data-options="
iconCls: 'icon-edit',
singleSelect: true,
url: '/Media/Cloud/index/',
method: 'post',
pagination: true,
pageList:[10,20,30,100],
rownumbers: true,
sortName:'updatetime',
sortOrder:'desc',
queryParams: form2Json('searchform'),
fitColumns: true,
height:'auto',
onRowContextMenu : onRowContextMenu
">
<thead>
<tr>
<th data-options="field:'id',width:15" align="center">ID</th>
<th field="url_pic" align="center" formatter="imageFormat">媒资海报</th>
<th data-options="field:'title',width:60" sortable="true">媒资标题</th>
<th data-options="field:'site_name',width:20" sortable="true">所属站点</th>
<th data-options="field:'code',width:15">媒资标识</th>
<th data-options="field:'type',width:10">媒资分类</th>
<th data-options="field:'programType',width:20">媒资类型</th>
<th data-options="field:'region',width:15">国家/地区</th>
<th data-options="field:'year',width:10">年份</th>
<th data-options="field:'score',width:10">评分</th>
<!--<th data-options="field:'addtime',width:25" sortable="true">创建时间</th>-->
<th data-options="field:'updatetime',width:25" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th>
<th field="action" align="center" formatter="InputAction">操作</th>
</tr>
</thead>
</table>
<div id="mm1" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('Media','Cloud','add')}>查看详情</div>
<!--<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('Media','Cloud','deletehandle')}>删除</div>-->
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('Media','Cloud','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('Media','Cloud','updateStatusAjaxHandle')}>启用</div>-->
</div>
<div id="mm2" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('Media','Cloud','add')}>查看详情</div>
<!--<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('Media','Cloud','deletehandle')}>删除</div>-->
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('Media','Cloud','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('Media','Cloud','updateStatusAjaxHandle')}>启用</div>-->
</div>
<script type="text/javascript">
function imageFormat(value, row, index) {
return "<a target='_blank' href='"+row.url_pic+"' title='点击查看'> <image src="+row.url_pic+" height='70px' width='100px'/></a>";
}
function onRowContextMenu(e, rowIndex, rowData){
e.preventDefault();
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', rowIndex);
$('#mm2').menu('show', {
left:e.pageX,
top:e.pageY
});
}
function InputAction(value, row, index) {
return'<a href="javascript:void(0)" id="mb' + index + '" class="easyui-menubutton" menu="#mm1" iconCls="icon-list" onmouseover="setSelectRow(' + index + ')">'+this.title+'</a>';
}
function TypeAction(value, row, index){
if(value==0){
return '主(Master)';
}else{
return '从(Slave)';
}
}
function setSelectRow(index) {
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', index);
}
//初始化菜单按钮
$(function(){
$('#dg').datagrid({
onLoadSuccess: function (data) {
for (i = 0; i < $('#dg').datagrid('getRows').length; i++) {
$('#mb' + i).menubutton();
}
}
})
});
//禁用启用
function enable(status){
var row = $('#dg').datagrid('getSelected');
if (row){
var msg='启用';
if(status==1)
msg='禁用'
$.messager.confirm('操作确认', '确认['+msg+']该记录?', function(r){
if (r){
$.post("/Media/Cloud/updateStatusAjaxHandle/", {id:row.id,status:status},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function add(){
pop(800,700,true,'dg','datagrid','/Media/Cloud/add/')
}
function edit(){
var row = $('#dg').datagrid('getSelected');
if (row){
pop(800,700,true,'','datagrid','/Media/Cloud/add/id/'+row.id);
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function del(){
var row = $('#dg').datagrid('getSelected');
if (row){
$.messager.confirm('操作确认', '确认[删除]该记录?', function(r){
if (r){
$.post("/Media/Cloud/deleteHandle/", {id:row.id},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
$("select[name='searchClass']").bind("change",function(){
var class_val = $(this).val();
$("select[name='searchType']").val('');
$("select[name='searchType'] option").hide();
$("select[name='searchType'] option:eq(0)").show();
$("select[name='searchType'] option[pid='"+class_val+"']").show();
});
$("#submit_search").click(function () {
$('#dg').datagrid({ queryParams: form2Json("searchform") }); //点击搜索
});
/**
* JQuery扩展方法,用户对JQuery EasyUI的DataGrid控件进行操作。
*/
$.fn.extend({
/**
* 修改DataGrid对象的默认大小,以适应页面宽度。
*
* @param heightMargin
* 高度对页内边距的距离。
* @param widthMargin
* 宽度对页内边距的距离。
* @param minHeight
* 最小高度。
* @param minWidth
* 最小宽度。
*
*/
resizeDataGrid : function(heightMargin, widthMargin, minHeight, minWidth) {
var height = $(document.body).height() - heightMargin;
var width = $(document.body).width() - widthMargin;
height = height < minHeight ? minHeight : height;
width = width < minWidth ? minWidth : width;
$(this).datagrid('resize', {
//height : height,
width : width
});
}
});
$(function() {
// datagrid数据表格ID
var datagridId = 'dg';
// 第一次加载时自动变化大小
$('#' + datagridId).resizeDataGrid(0, 5, 0, 0);
// 当窗口大小发生变化时,调整DataGrid的大小
$(window).resize(function() {
$('#' + datagridId).resizeDataGrid(0, 5, 0, 0);
});
});
</script>
</body>
</html>