activateList.html
13.1 KB
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/union/js/include.js"></script>
<script src="/union/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div id="tt" class="easyui-tabs" style="width:auto;height:auto;">
<div title="激活点击统计" style="padding:20px;display:none;">
<div id="search" region="north" style="padding-bottom: 35px; ">
<!--<script>-->
<!--document.write(addHead('市场管理', '分组营销管理'));-->
<!--</script>-->
<style>
.div_search input {
margin-top: 20px;
}
.div_search .textbox {
margin-top: 20px;
}
.div_search .easyui-linkbutton {
margin-top: 20px;
}
.subtotal {
font-weight: bold;
}
/*合计单元格样式*/
</style>
<div style="margin-left: 30px;" class="div_search">
<form id="searchForm" method="post" accept-charset="utf-8">
<input name="interfaceType" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
textField: 'text',
width:200,
prompt:'选择泛激活接口',
data: [
{ id: '', text: '全部' },
{ id: 'addUnion_ios', text: 'addUnion_ios' },
{ id: 'addUnion_android', text: 'addUnion_android' },
{ id: 'addUnion4Jump_ios', text: 'addUnion4Jump_ios' },
{ id: 'addUnion4Jump_android', text: 'addUnion4Jump_android' },
{ id: 'addMonitor_ios', text: 'addMonitor_ios' },
{ id: 'addMonitor_android', text: 'addMonitor_android' }
]"/>
<input name="unionType" type="text" class="easyui-textbox" data-options="prompt:'请输入渠道号'"
style="width: 200px;">
<input id="activateTime" name="activateTime" type="text" class="easyui-datebox" editable="false"
data-options="prompt:'请选择激活日期'" style="width: 200px;">
<a id="searchBtn" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
</form>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height:800px;">
<table id="activateTalbe"></table>
</div>
</div>
</div>
<div title="激活点击查询" data-options="closable:true" style="overflow:auto;padding:20px;display:none;">
<div id="search2" region="north" style="padding-bottom: 35px; ">
<form id="searchForm2" method="post" accept-charset="utf-8">
<input name="idfa" type="text" class="easyui-textbox" data-options="prompt:'请输入idfa'"
style="width: 200px;">
<input name="imei" type="text" class="easyui-textbox" data-options="prompt:'请输入imei'"
style="width: 200px;">
<a id="searchBtn2" class="easyui-linkbutton btn-info" style="margin-left: 30px; "></a>
<div id="batchImportDiv" style="margin-left: 30px;"></div>
</form>
</div>
<div region="center" style="height: 800px;">
<div style="margin-left: 30px;margin-top: 20px; height:100px;">
<table id="activateTalbe2"></table>
</div>
<div id="matchDiv" style="padding:30px;height:600px;"></div>
</div>
</div>
</div>
<script>
$(function () {
var currentDate = getNowFormatDate();
$('#activateTime').datebox('setValue', currentDate);
$("#activateTalbe").myDatagrid({
fit: true,
fitColumns: true,
//queryParams: param,
nowrap: false,
url: '',
// url: contextPath + "/ActivateUnionRest/queryActivateDeviceId",
method: 'POST',
queryParams: getParams(),
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "渠道Id",
field: "unionType",
width: 200,
align: "center"
}, {
title: "渠道名称",
field: "unionName",
width: 250,
align: "center"
}, {
title: "激活IOS数",
field: "idfaCount",
width: 180,
align: "center"
}, {
title: "点击IOS数",
field: "idfaClick",
width: 180,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "<a role='idfa' dataId='" + rowData.unionType + "' style='margin-left:10px'></a>";
return str;
}
}, {
title: "激活安卓数",
field: "imeiCount",
width: 180,
align: "center"
}, {
title: "点击安卓数",
field: "imeiClick",
width: 180,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "<a role='imei' dataId='" + rowData.unionType + "' style='margin-left:10px'></a>";
return str;
}
}
]],
cache: false,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function (data) {
$(this).myDatagrid("getPanel").find("a[role='idfa']").linkbutton({
iconCls: "icon-more",
text: '查看',
onClick: function () {
// showIdfaClick($(this).attr("dataId"));
var p = $(this).parent();
var params = getParams();
params['unionType'] = $(this).attr("dataId");
params['isIdfa'] = 1;
$.post(contextPath + "/ActivateUnionRest/queryActivateCount", params, function (data) {
// h.text(data);
var sp = p.children("span");
sp.remove();
p.append("<span> " + data + "</span>");
}, "json");
}
});
$(this).myDatagrid("getPanel").find("a[role='imei']").linkbutton({
iconCls: "icon-more",
text: '查看',
onClick: function () {
// showImeiClick($(this).attr("dataId"));
var p = $(this).parent();
var params = getParams();
params['unionType'] = $(this).attr("dataId");
params['isIdfa'] = 0;
$.post(contextPath + "/ActivateUnionRest/queryActivateCount", params, function (data) {
// h.text(data);
var sp = p.children("span");
sp.remove();
p.append("<span> " + data + "</span>");
}, "json");
}
});
$('#activateTalbe').datagrid('appendRow', {
unionType: '<span class="subtotal">统计</span>',
unionName: '<span class="subtotal"></span>',
idfaCount: '<span class="subtotal">' + compute("idfaCount") + '</span>',
idfaClick: '<span class="subtotal">0</span>',
imeiCount: '<span class="subtotal">' + compute("imeiCount") + '</span>',
imeiClick: '<span class="subtotal"></span>'
});
function compute(colName) {
var rows = $('#activateTalbe').datagrid('getRows');
var total = 0;
for (var i = 0; i < rows.length; i++) {
total += parseFloat(rows[i][colName]);
}
return total;
}
}
});
$("#activateTalbe2").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: '',
method: 'POST',
queryParams: getParams2(),
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "渠道Id",
field: "unionType",
width: 200,
align: "center"
}, {
title: "渠道名称",
field: "unionName",
width: 250,
align: "center"
}, {
title: "idfa",
field: "idfa",
width: 180,
align: "center"
}, {
title: "imei",
field: "imei",
width: 180,
align: "center"
}, {
title: "激活时间",
field: "createTime",
width: 180,
align: "center"
}
, {
title: "激活接口",
field: "interfaceType",
width: 180,
align: "center"
}
]],
cache: false,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false
});
function getParams() {
var paramsArray = $("#searchForm").serializeArray();
var params = {};
for (var i = 0; i < paramsArray.length; i++) {
params[paramsArray[i].name] = paramsArray[i].value;
}
return params;
}
function getParams2() {
var paramsArray = $("#searchForm2").serializeArray();
var params = {};
for (var i = 0; i < paramsArray.length; i++) {
params[paramsArray[i].name] = paramsArray[i].value;
}
return params;
}
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
$("#searchBtn").linkbutton({
iconCls: "icon-search",
text: "查询",
onClick: function () {
$("#activateTalbe").datagrid(
{
url: contextPath + "/ActivateUnionRest/queryActivateDeviceId",
queryParams: getParams()
});
}
});
$("#searchBtn2").linkbutton({
iconCls: "icon-search",
text: "查询",
onClick: function () {
// var params = getParams2();
// $.post(contextPath + "/ActivateUnionRest/queryByDeviceId", params, function (data) {
// var activate = data.data;
//
// }, "json");
$("#activateTalbe2").datagrid(
{
url: contextPath + "/ActivateUnionRest/queryByDeviceId",
queryParams: getParams2()
});
}
});
$("#batchImportDiv").fileUpload({
text: "请选择文件导入匹配", //按钮文字
uploadInputName: "file", //上传文件的控件名称
url: contextPath + "/batch/import", //提交到后端的url
queryParams: {
type: "deviceIdMatchImport"
}, //提交到后端额外参数
showFileName: false, //上传成功后,是否显示文件名
onLoadSuccess: function (fileName, data) {
$.messager.show({
title: "提示",
msg: "匹配完成",
height: 250
});
var match = data.data;
var output = "匹配的内容</br>";
for (var i = 0; i < match.length; i++) {
output += match[i] + "</br>";
}
$("#matchDiv").append(output);
}
});
});
</script>
</body>
</html>