提交 ff62d8dd authored 作者: matian's avatar matian

bug fixes

上级 eec4980b
......@@ -6,7 +6,7 @@ const form = reactive({
type: '0',
progress: '',
score: '',
open: '1',
open: '0',
start_time: '',
end_time: ''
})
......@@ -25,12 +25,17 @@ const props = defineProps({
},
course_id: {
type: String
},
controlInfo: {
type: Object
}
})
interface Emits {
(e: 'update:isShowOpenRules', isShowOpenRules: boolean): void
(e: 'create'): void
}
const controlInfo = ref(Object.assign({}, props.controlInfo))
const handleCancel = () => {
emit('update:isShowOpenRules', false)
}
......@@ -42,9 +47,21 @@ const handleConfirm = () => {
ElMessage.success('章节开放规则设置成功')
})
}
form.type = controlInfo.value.type.toString()
if (form.type === '1') {
form.progress = controlInfo.value.rules.progress
} else if (form.type === '2') {
form.score = controlInfo.value.rules.score
} else if (form.type === '3') {
form.start_time = controlInfo.value.rules.start_time
form.end_time = controlInfo.value.rules.end_time
} else if (form.type === '4') {
form.open = controlInfo.value.rules.open.toString()
}
</script>
<template>
<el-dialog :model-value="isShowOpenRules" :before-close="handleCancel" title="章节开放规则" width="50vw">
<el-dialog :model-value="isShowOpenRules" :before-close="handleCancel" title="章节开放规则" width="60vw">
<el-form :model="form" laebl-suffix=":" label-width="100px">
<el-form-item label="章名称:" prop="chapter">{{ props.chapterName }}</el-form-item>
<el-form-item label="小节名称:" prop="section">{{ props.sectionName || '无' }}</el-form-item>
......@@ -63,9 +80,21 @@ const handleConfirm = () => {
>
<el-radio label="3">
时间范围:
<el-date-picker v-model="form.start_time" type="date" style="width: 150px"> </el-date-picker>
<el-date-picker
v-model="form.start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 200px"
>
</el-date-picker>
~
<el-date-picker v-model="form.end_time" type="date" style="width: 150px"> </el-date-picker>
<el-date-picker
v-model="form.end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 200px"
>
</el-date-picker>
</el-radio>
<el-radio label="4">
手工开放:<el-switch
......
......@@ -29,6 +29,7 @@ const btnInfo = ref({}) // 按钮信息
const isEdit = ref(false)
const videoUrl = ref('')
const sectionName = ref('')
const controlInfo = ref({})
const defaultExpandedKeys: any = ref([])
const flag = ref(false)
const btnList = [
......@@ -68,7 +69,7 @@ const defaultProps = {
// 获取章节列表
onMounted(() => {
checkPermission('v1-course-chapters') && handleChapterList()
checkPermission('v1-course-chapters') && handleChapterList()
})
const handleChapterList = () => {
getCharacter({ course_id: id, type: 'tree' }).then((res: any) => {
......@@ -106,7 +107,6 @@ const handleAddSection = (node: any) => {
}
//编辑章节
const handleEdit = (node: any) => {
chapterID.value = node.key
isEdit.value = true
chapterID.value = node.key
if (node.level === 1) {
......@@ -271,14 +271,17 @@ const handleNodeCollapse = () => {
}
// 设置开放规则
const handleOpenRules = (node: any, data: any) => {
console.log(node, '000000000000')
if (node.level === 1) {
chapterName.value = node.label
sectionName.value = '无'
chapterID.value = node.key
controlInfo.value = data.control
} else {
chapterName.value = data.parent_name
chapterID.value = data.parent_id
chapterID.value = node.key
sectionName.value = node.label
controlInfo.value = data.control
}
isShowOpenRules.value = true
}
......@@ -516,6 +519,7 @@ const handleChangeStatus = (node: any, data: any) => {
:sectionName="sectionName"
:chapterID="chapterID"
:course_id="id"
:controlInfo="controlInfo"
@create="handleFresh"
/>
</template>
......
......@@ -156,6 +156,20 @@ watch(
() => props.data,
value => {
authorizeCheck.value = value.auth_departments.reduce((a: any, b: any) => a.push(b.department_id) && a, [])
departmentList.value.map((i: any) => {
value.auth_departments.map((item: any) => {
if (item.organ_id === i.id) {
i.auth_type = item.auth_type
if (item.auth_semester_id === '0') {
i.auth_semester_id = ''
} else {
i.auth_semester_id = item.auth_semester_id
}
i.auth_start_time = item.auth_start_time
i.auth_end_time = item.auth_start_time
}
})
})
}
)
......
......@@ -53,7 +53,7 @@ const handleClose = (val: any) => {
}
</script>
<template>
<el-dialog title="批量导入视频" :close-on-click-modal="false" :before-close="handleCancel" width="45vw">
<el-dialog title="批量导入视频" :close-on-click-modal="false" :before-close="handleCancel" width="50vw">
<el-form :model="form" label-suffix=":">
<el-form-item label="视频分类" prop="classification">
<el-tree-select
......
......@@ -88,6 +88,7 @@ function onUploadStarted(uploadInfo: UploadInfo) {
uploader.setUploadAuthAndAddress(uploadInfo, res.data.upload_auth, res.data.upload_address, res.data.source_id)
})
updateFileList(uploadInfo)
emit('canClose', { closeStatus: false })
}
// 文件上传成功
function onUploadSucceed(uploadInfo: UploadInfo) {
......@@ -97,6 +98,7 @@ function onUploadSucceed(uploadInfo: UploadInfo) {
}
//文件上传失败
function onUploadFailed(uploadInfo: UploadInfo, code: number, message: string) {
console.log(uploadInfo, '111111')
console.log('onUploadFailed', uploadInfo, code, message)
updateFileList(uploadInfo)
}
......@@ -117,6 +119,7 @@ function onUploadTokenExpired(uploadInfo: UploadInfo) {
function onUploadEnd(uploadInfo: UploadInfo) {
console.log('onUploadEnd', uploadInfo)
updateFileList(uploadInfo)
emit('canClose', { closeStatus: true })
}
const handleView = () => {
......@@ -135,7 +138,7 @@ defineExpose({ uploader, fileList: $$(fileList) })
<input accept=".mp4" type="file" id="fileUpload" multiple @change="fileChange" />
</div>
<div class="tips">推荐视频格式:帧率为25fps\输出码率为4M\输出格式为mp4,建议采用格式工厂等工具处理后上传。</div>
<div v-for="(item, index) in fileList.slice(0, 3)" :key="index">
<div v-for="(item, index) in fileList" :key="index">
<div class="video-info">
<span class="name">{{ item.file?.name }}</span>
<el-progress style="width: 200px" :percentage="percentage(item.loaded)" class="view" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论