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
<?php
/**
* 视频一览
* $Id: media_list.inc,v 1.1 2020/01/03 11:18:46 Exp $
* @author lixq
* @access public
* @package manager.templates
*/
?>
<style type="text/css">
.m-l{
margin-left: 10px;
}
</style>
<div id="classSetting">
<div class="list_title">
视频列表
</div>
<br/>
<form id="search_form" action="media_list.php" method="post" style="padding-left: 43px;font-size: 14px;">
<input type="hidden" name="media_type" value="<?=$media_type?>"/>
<input type="hidden" name="media_kind" value="<?=$media_kind?>"/>
视频种类:<el-select v-model="media_type" size="small" style="width:100px;margin-left: 10px;">
<el-option
v-for="item in media_type_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
视频类型:<el-select v-model="media_kind" size="small" style="width:100px;margin-left: 10px;">
<el-option
v-for="item in media_kind_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
视频名称:<input type="text" value="<?=$title?>" name="title" class="el-input__inner input_100 m-l"/>
<el-button type="primary" @click="search()" class="edit_btn search_btn" style="padding: 5px 10px;">检索</el-button>
</form>
<br />
<div class="result_list">
<el-table :data="tableData" border>
<el-table-column prop="title" label="视频名称" width=""></el-table-column>
<el-table-column prop="tags" label="视频标签" width=""></el-table-column>
<el-table-column prop="media_type" label="视频类型" width=""></el-table-column>
<el-table-column prop="media_kind" label="视频种类" width=""></el-table-column>
<el-table-column prop="size" label="视频大小" width=""></el-table-column>
<el-table-column prop="upload_time" label="上传时间" width=""></el-table-column>
<el-table-column prop="view_count" label="观看人数" width=""></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleChange(scope.row)" type="text" size="small">编辑</el-button>
<el-button type="text" size="small" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<?
if ($course_count > 0) {
?>
<!--page begin-->
<?
require_once("page_common.inc");
?>
<!--page end-->
<?
}
?>
<script type="text/javascript">
var list=[];
<?
foreach ($course_list as $tmp) {
?>
var data={
id:<?=$tmp->id ?>,
title:'<?=$tmp->title?>',
media_kind:'<?=$tmp->is_free == true?"志愿免费":"公益收费"?>',
media_type:'<?=$tmp->course_id == 0?"单个":"合集"?>',
tags:'<?=$tmp->tags?>',
size:'<?=round($tmp->size /1024 /1024,2)?>M',
upload_time:'<?=$tmp->registration_date?>',
view_count:<?=$tmp->view_count?>
};
list.push(data);
<?
}
?>
new Vue({
el:'#classSetting',
data:{
tableData: list,
media_type:'<?=$media_type?>',
media_kind:'<?=$media_kind?>',
media_type_list:[{"id":"0","title":"请选择"},{"id":"1","title":"单个"},{"id":"2","title":"合集"}],
media_kind_list:[{"id":"0","title":"请选择"},{"id":"1","title":"志愿免费"},{"id":"2","title":"公益收费"}],
},
methods:{
handleChange(row) {
window.location.href='media_edit_input.php?id='+row.id;
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
window.location.href='media_delete_result.php?id='+rows.id;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
search(){
$("input[name='media_type']").val(this.media_type);
$("input[name='media_kind']").val(this.media_kind);
$("#search_form").submit();
}
}
})
</script>