From 822b60fd6a7d73708b908123e6d5b976fb38264a Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 22 Dec 2021 14:59:25 +0800
Subject: [PATCH] fix
---
src/main/java/cc/mrbird/febs/video/controller/AdminVideoController.java | 2
src/main/resources/templates/febs/views/video/video/video-list.html | 52 +++++++++++++++++++++++---
src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterSourceServiceImpl.java | 2
src/main/resources/application-dev.yml | 5 ++
src/main/resources/mapper/video/VideoMasterInfoMapper.xml | 6 +++
5 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/video/controller/AdminVideoController.java b/src/main/java/cc/mrbird/febs/video/controller/AdminVideoController.java
index aac1578..0d5a12f 100644
--- a/src/main/java/cc/mrbird/febs/video/controller/AdminVideoController.java
+++ b/src/main/java/cc/mrbird/febs/video/controller/AdminVideoController.java
@@ -89,7 +89,7 @@
@RequiresPermissions("source:add")
@ControllerEndpoint(operation = "新增资源", exceptionMessage = "新增资源失败")
public FebsResponse addVideoSource(VideoMasterSourceEntity source) {
- this.videoMasterSourceService.save(source);
+ this.videoMasterSourceService.addSource(source);
return new FebsResponse().success();
}
diff --git a/src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterSourceServiceImpl.java b/src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterSourceServiceImpl.java
index b67a20f..d35ee28 100644
--- a/src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterSourceServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterSourceServiceImpl.java
@@ -85,7 +85,7 @@
private String timeFormat(Integer time) {
int minutes = time / 60;
- int second = time - time * 60;
+ int second = time - minutes * 60;
return minutes + ":" + second;
}
}
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index ce7dcb3..4d5909d 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -58,6 +58,11 @@
images:
path: /home/javaweb/webresource/video/
url: http://120.27.238.55:8000/video/
+#system:
+# images:
+# path: /Users/helius/Desktop/
+# url: http://localhost:1234/
+
pay:
ali:
diff --git a/src/main/resources/mapper/video/VideoMasterInfoMapper.xml b/src/main/resources/mapper/video/VideoMasterInfoMapper.xml
index 1332c0e..92238e5 100644
--- a/src/main/resources/mapper/video/VideoMasterInfoMapper.xml
+++ b/src/main/resources/mapper/video/VideoMasterInfoMapper.xml
@@ -14,6 +14,12 @@
<if test="record.title != null and record.title != ''">
and a.title like concat('%', #{record.title}, '%')
</if>
+ <if test="record.isUp != null">
+ and a.is_up = #{record.isUp}
+ </if>
+ <if test="record.isFree != null">
+ and a.is_free = #{record.isFree}
+ </if>
group by a.id
</select>
diff --git a/src/main/resources/templates/febs/views/video/video/video-list.html b/src/main/resources/templates/febs/views/video/video/video-list.html
index 1e72d99..04fdee8 100644
--- a/src/main/resources/templates/febs/views/video/video/video-list.html
+++ b/src/main/resources/templates/febs/views/video/video/video-list.html
@@ -10,7 +10,7 @@
<div class="layui-inline">
<label class="layui-form-label layui-form-label-sm">视频名称</label>
<div class="layui-input-inline">
- <input type="text" name="name" autocomplete="off" class="layui-input">
+ <input type="text" name="title" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
@@ -27,7 +27,7 @@
<div class="layui-inline">
<label class="layui-form-label layui-form-label-sm">是否会员</label>
<div class="layui-input-inline">
- <select name="isUp">
+ <select name="isFree">
<option value=""></option>
<option value="1">免费</option>
<option value="2">会员</option>
@@ -43,9 +43,11 @@
<div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset">
<i class="layui-icon"></i>
</div>
- <div class="layui-btn layui-btn-sm layui-btn-primary table-action action-more"
- shiro:hasAnyPermissions="video:add,video:delete">
- <i class="layui-icon"></i>
+ <div shiro:hasAnyPermissions="video:add" class="layui-btn layui-btn-sm layui-btn-primary febs-button-cyan-plain table-action" id="add">
+ <i class="layui-icon"></i>
+ </div>
+ <div shiro:hasAnyPermissions="video:delete" class="layui-btn layui-btn-sm layui-btn-primary febs-button-red-plain table-action" id="del">
+ <i class="layui-icon"></i>
</div>
</div>
</div>
@@ -60,6 +62,12 @@
.layui-table-cell {
height: 100%;
}
+
+ .febs-button-cyan-plain{color: #fabc6d;background: #fceedd !important;border-color:#fedbae;}
+ .febs-button-cyan-plain:hover{color:#fabc6d;background:#fceedd !important;border-color:#fedbae;box-shadow:0 4px 8px 0 #fedbae;}
+
+ .febs-button-red-plain{color:#fb6678;background:#ffdfe3 !important;border-color:#ff8e9b;}
+ .febs-button-red-plain:hover{color:#fb6678;background:#ffdfe3 !important;border-color:#ff8e9b;box-shadow:0 4px 8px 0 #ff8e9b;}
</style>
<script type="text/html" id="thumbFormat">
<img src="{{d.thumb}}" />
@@ -106,6 +114,8 @@
$view = $('#febs-video'),
$query = $view.find('#query'),
$reset = $view.find('#reset'),
+ $add = $view.find('#add'),
+ $del = $view.find('#del'),
$searchForm = $view.find('form'),
sortObject = {field: 'createTime', type: null},
tableIns,
@@ -206,6 +216,36 @@
});
});
+ $add.on('click', function () {
+ febs.modal.view('新增视频', 'video/add', {
+ btn: ['提交', '重置'],
+ area: ['100%', '100%'],
+ yes: function (index, layero) {
+ $('#video-add').find('#submit').trigger('click');
+ },
+ btn2: function () {
+ $('#video-add').find('#reset').trigger('click');
+ return false;
+ }
+ });
+ })
+
+ $del.on('click', function() {
+ var checkStatus = table.checkStatus('videoTable');
+
+ if (!checkStatus.data.length) {
+ febs.alert.warn('请选择需要删除的视频');
+ } else {
+ febs.modal.confirm('删除视频', '确定删除该视频?', function () {
+ var userIds = [];
+ layui.each(checkStatus.data, function (key, item) {
+ userIds.push(item.userId)
+ });
+ deleteUsers(userIds.join(','));
+ });
+ }
+ })
+
$query.on('click', function () {
var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
tableIns.reload({where: params, page: {curr: 1}});
@@ -241,7 +281,7 @@
function getQueryParams() {
return {
- name: $searchForm.find('input[name="name"]').val().trim(),
+ title: $searchForm.find('input[name="title"]').val().trim(),
isUp: $searchForm.find("select[name='isUp']").val(),
isFree: $searchForm.find("select[name='isFree']").val(),
invalidate_ie_cache: new Date()
--
Gitblit v1.9.1