proPhoto.js
2.02 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
/**
* Created by JiangMin on 2016/3/22.
* 产品图片管理
*/
var $ = require('jquery');
var common = require('../common/common');
/**
* 列表显示数据
* @type {common.grid}
*/
var g = new common.grid({
el: '#content-list',
hash: false,
//查询参数
parms: function () {
return {
//查询参数
productSkn: common.util.__input('content-filter1'),
productSkc: common.util.__input('content-filter2'),
productSku: common.util.__input('content-filter3'),
startTime: common.util.__input('startTime'),
endTime: common.util.__input('endTime')
};
},
//列表显示
columns: [
{display: "SKN", name: "productSkn"},
{
display: "最后上传时间", name: "updateTime",
render: function (item) {
var t = new Date(item.updateTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},
{
display: "图片", name: "pictureBoList", render: function (item) {
var a=item.pictureBoList;
if(a.length>0){
var b;
for(var i=0;i< a.length;i++){
b=b+'<img src="' + item.pictureBoList[i].fileName + '" width="100" height="60"/>'
}
return b.substr(9);
}
//return '<img src="' + item.pictureBoList[0].fileName + '" width="100" height="60"/>'
//console.log("item.pictureBoList", item.pictureBoList);
}
},
{
display: "操作", name: "", render: function (item) {
var arr = [];
arr.push('<a class="btn btn-info update" data-index="' + item.__index + '">修改</a>');
arr.push('<a class="btn btn-danger delete" data-index="' + item.__index + '">删除</a>');
return arr.join('');
}
}
]
});
g.init("/shotManage/proPhoto/index2");