diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 308a03791..b586e965e 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -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("", height, width, _target, value); + } else { + return $.common.nullToStr(value); + } + }, // 搜索-默认第一个form search: function(formId, tableId) { table.set(tableId); diff --git a/ruoyi-front/src/main/resources/templates/front/courses/courses.html b/ruoyi-front/src/main/resources/templates/front/courses/courses.html index 6bb63cb4f..dbf1e2a47 100644 --- a/ruoyi-front/src/main/resources/templates/front/courses/courses.html +++ b/ruoyi-front/src/main/resources/templates/front/courses/courses.html @@ -136,7 +136,12 @@ }, { field: 'videoUrl', - title: '视频地址' + title: '视频地址', + width : 200, + height : 300, + formatter: function(value, row, index) { + return $.table.videoView(value); + } }, { field: 'status',