增加视频播放共用方法
This commit is contained in:
parent
79d1527adc
commit
54cc032fb5
|
|
@ -336,6 +336,22 @@ var table = {
|
|||
return $.common.nullToStr(value);
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
videoView: function (value, height, width, target) {
|
||||
if ($.common.isEmpty(width)) {
|
||||
width = 'auto';
|
||||
}
|
||||
if ($.common.isEmpty(height)) {
|
||||
height = 'auto';
|
||||
}
|
||||
// blank or self
|
||||
var _target = $.common.isEmpty(target) ? 'self' : target;
|
||||
if ($.common.isNotEmpty(value)) {
|
||||
return $.common.sprintf("<video controls data-height='%s' data-width='%s' data-target='%s'><source src='%s' type='video/mp4'></video>", height, width, _target, value);
|
||||
} else {
|
||||
return $.common.nullToStr(value);
|
||||
}
|
||||
},
|
||||
// 搜索-默认第一个form
|
||||
search: function(formId, tableId) {
|
||||
table.set(tableId);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,12 @@
|
|||
},
|
||||
{
|
||||
field: 'videoUrl',
|
||||
title: '视频地址'
|
||||
title: '视频地址',
|
||||
width : 200,
|
||||
height : 300,
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.videoView(value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
|
|
|
|||
Loading…
Reference in New Issue