|
|
@@ -81,6 +81,8 @@
|
|
|
v-hasPermi="['course:courseWatchComment:list']">查看评论</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['course:userCourseVideo:remove']">删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-time" @click="handleTaskList(scope.row)"
|
|
|
+ v-hasPermi="['course:userCourseVideo:edit']">定时管理</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -185,6 +187,7 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
+ <el-button v-if="form.videoId != null" type="primary" @click="saveTask">定时发布</el-button>
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
@@ -312,6 +315,65 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="选择时间" :visible.sync="taskDialog.open" width="500px" append-to-body>
|
|
|
+ <el-form ref="taskForm" :model="taskDialog.form" :rules="taskDialog.rules" label-width="110px">
|
|
|
+ <el-form-item label="发布时间" prop="planReleaseTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="taskDialog.form.planReleaseTime"
|
|
|
+ type="datetime"
|
|
|
+ :picker-options="taskDialog.pickerOptions"
|
|
|
+ placeholder="选择日期时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitTask">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="任务管理" :visible.sync="taskListDialog.open" width="1600px" append-to-body>
|
|
|
+ <el-table border v-loading="taskListDialog.loading" :data="taskListDialog.list">
|
|
|
+ <el-table-column label="TaskId" align="center" prop="id" />
|
|
|
+ <el-table-column label="视频ID" align="center" prop="videoId" />
|
|
|
+ <el-table-column label="小节名称" align="center" show-overflow-tooltip prop="title" />
|
|
|
+ <el-table-column label="视频文件名称" align="center" show-overflow-tooltip prop="fileName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="视频时长" align="center" prop="duration">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ formatDuration(row.duration) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="视频备注" align="center" show-overflow-tooltip prop="remark" />
|
|
|
+ <el-table-column label="红包金额" align="center" prop="redPacketMoney" />
|
|
|
+ <el-table-column label="排序" align="center" prop="courseSort" />
|
|
|
+ <el-table-column label="发布状态" align="center" prop="releaseStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.releaseStatus === 1">待发布</el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.releaseStatus === 2" type="success">已发布</el-tag>
|
|
|
+ <el-tag v-else type="info">已作废</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务提交时间" align="center" prop="taskCreateTime" width="100" />
|
|
|
+ <el-table-column label="计划发布时间" align="center" prop="planReleaseTime" width="100"/>
|
|
|
+ <el-table-column label="实际发布时间" align="center" prop="releaseTime" width="100"/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ v-if="scope.row.releaseStatus === 1"
|
|
|
+ v-hasPermi="['course:userCourseVideoTask:abandon']"
|
|
|
+ @click="handleAbandon(scope.row)">作废</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="taskListDialog.total > 0"
|
|
|
+ :total="taskListDialog.total"
|
|
|
+ :page.sync="taskListDialog.queryParams.pageNum"
|
|
|
+ :limit.sync="taskListDialog.queryParams.pageSize"
|
|
|
+ @pagination="getTaskList" />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -335,10 +397,12 @@ import { getByIds } from '@/api/course/courseQuestionBank'
|
|
|
import CourseWatchComment from "./courseWatchComment.vue";
|
|
|
import { getCateListByPid, getCatePidList } from '@/api/course/userCourseCategory'
|
|
|
import draggable from 'vuedraggable'
|
|
|
+import { abandon, listUserCourseVideoTask } from '@/api/course/userCourseVideoTask'
|
|
|
+import Template from '@/views/his/complaint/template.vue'
|
|
|
|
|
|
export default {
|
|
|
name: "userCourseCatalog",
|
|
|
- components: { VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable },
|
|
|
+ components: { Template, VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable },
|
|
|
data() {
|
|
|
return {
|
|
|
duration: null,
|
|
|
@@ -459,6 +523,34 @@ export default {
|
|
|
videoId: null,
|
|
|
title: ""
|
|
|
},
|
|
|
+ taskDialog: {
|
|
|
+ open: false,
|
|
|
+ form: {
|
|
|
+ planReleaseTime: null
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ planReleaseTime: [
|
|
|
+ { required: true, message: "发布时间不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < Date.now()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ taskListDialog: {
|
|
|
+ open: false,
|
|
|
+ total: 0,
|
|
|
+ list: [],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ videoId: null
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -814,7 +906,12 @@ export default {
|
|
|
}
|
|
|
if (this.form.videoId != null) {
|
|
|
updateUserCourseVideo(this.form).then(response => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
+ if (this.form.planReleaseTime != null) {
|
|
|
+ this.msgSuccess("操作成功");
|
|
|
+ this.taskDialog.open = false
|
|
|
+ } else {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ }
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
@@ -828,6 +925,50 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ saveTask() {
|
|
|
+ this.taskDialog.form = {
|
|
|
+ planReleaseTime: null
|
|
|
+ }
|
|
|
+ this.taskDialog.open = true
|
|
|
+ this.resetForm("taskForm");
|
|
|
+ },
|
|
|
+ submitTask() {
|
|
|
+ this.$refs["taskForm"].validate(valid => {
|
|
|
+ if (!valid) {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择发布时间!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form.planReleaseTime = this.taskDialog.form.planReleaseTime
|
|
|
+ this.submitForm()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleTaskList(row) {
|
|
|
+ this.taskListDialog.queryParams= {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ videoId: row.videoId
|
|
|
+ }
|
|
|
+ this.getTaskList()
|
|
|
+ this.taskListDialog.open = true
|
|
|
+ },
|
|
|
+ getTaskList() {
|
|
|
+ this.taskListDialog.loading = true;
|
|
|
+ listUserCourseVideoTask(this.taskListDialog.queryParams).then(response => {
|
|
|
+ this.taskListDialog.list = response.rows;
|
|
|
+ this.taskListDialog.total = response.total;
|
|
|
+ this.taskListDialog.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAbandon(row) {
|
|
|
+ abandon(row.id).then(() => {
|
|
|
+ this.msgSuccess("操作成功")
|
|
|
+ this.getTaskList()
|
|
|
+ })
|
|
|
+ },
|
|
|
openUpdates() {
|
|
|
this.updateBatchData.form = {};
|
|
|
this.updateBatchData.open = true;
|