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

updates

上级 20183200
......@@ -33,7 +33,18 @@ const listOptions = $computed(() => {
columns: [
{ label: '序号', type: 'index', align: 'center', minWidth: '100' },
{ label: '课程名称', prop: 'name', align: 'center', minWidth: '100' },
{ label: '别名', prop: 'alias_name', slots: 'alias_name', align: 'center', width: '200px' },
{
label: '别名',
prop: 'alias_name',
slots: 'alias_name',
align: 'center',
width: '200px',
computed(row: any) {
if (row.row.alias_name === '') {
return (row.row.alias_name = row.row.name)
}
}
},
{ label: '课程类型', prop: 'online_type_name', align: 'center', minWidth: '100' },
{ label: '选课类型', prop: 'elective_type_name', align: 'center', minWidth: '100' },
{ label: '课程分类', prop: 'classification_name', align: 'center', minWidth: '350' },
......@@ -88,6 +99,7 @@ const handleChangeName = (row: any) => {
}
setAliasName(params).then(() => {
ElMessage.success('课程别名设置成功')
handleFresh()
})
}
</script>
......@@ -115,7 +127,11 @@ const handleChangeName = (row: any) => {
<el-input
v-model="row.alias_name"
@blur="handleChangeName(row)"
:disabled="!checkPermission('v1-learning-semester-set-course-alias-name')"
:disabled="
!checkPermission('v1-learning-semester-set-course-alias-name') ||
row.organ_id_name === semInfo.organ_id_name
"
:placeholder="row.name"
></el-input>
</template>
<template #table-operate="{ row }">
......
......@@ -87,7 +87,7 @@ const imgUrl = (val: any) => {
}
const handleChangeStatus = (row: any) => {
if (row.id !== undefined && dataList.length > 0) {
if (row.id !== undefined) {
const params: any = {
course_id: props.id,
information_id: row.id,
......
......@@ -44,7 +44,7 @@ const handleConfirm = () => {
}
</script>
<template>
<el-dialog :model-value="isShowOpenRules" :before-close="handleCancel" title="章节开放规则">
<el-dialog :model-value="isShowOpenRules" :before-close="handleCancel" title="章节开放规则" width="50vw">
<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 +63,9 @@ const handleConfirm = () => {
>
<el-radio label="3">
时间范围:
<el-date-picker v-model="form.start_time" type="date"> </el-date-picker>
<el-date-picker v-model="form.start_time" type="date" style="width: 150px"> </el-date-picker>
~
<el-date-picker v-model="form.end_time" type="date"> </el-date-picker>
<el-date-picker v-model="form.end_time" type="date" style="width: 150px"> </el-date-picker>
</el-radio>
<el-radio label="4">
手工开放:<el-switch
......@@ -88,3 +88,8 @@ const handleConfirm = () => {
</template>
</el-dialog>
</template>
<style lang="scss" scoped>
:deep(.el-radio) {
margin-top: 20px;
}
</style>
......@@ -137,13 +137,23 @@ const statusStyle = (item: any) => {
<div v-html="item.summarize"></div>
<template #reference>
<div class="item">
<div class="avatar" :style="`background-image:url(${item.avatar})`"></div>
<!-- <div class="avatar" :style="`background-image:url(${item.avatar})`"></div> -->
<img :src="item.avatar" class="avatar" />
<div class="name">{{ item.name }}</div>
</div>
</template>
</el-popover>
</div>
</div>
<div class="lecturer-list" style="margin-top: 20px">
<div class="list-name">助教</div>
<div v-for="item in props.data.teachers" :key="item.id">
<div class="item1">
<img class="avatar" src="https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png" />
<div class="name">{{ item.name }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
......@@ -223,14 +233,38 @@ const statusStyle = (item: any) => {
}
.item {
margin-left: 25px;
width: 115px;
min-width: 115px;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
margin: 0 auto;
}
.name {
text-align: center;
font-size: 16px;
font-weight: 500;
line-height: 100%;
color: #333333;
white-space: nowrap;
}
}
.item1 {
margin-left: 13px;
min-width: 115px;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
.avatar {
width: 40px;
height: 40px;
background-size: cover;
border-radius: 50%;
margin: 0 auto;
}
......@@ -240,7 +274,7 @@ const statusStyle = (item: any) => {
font-weight: 500;
line-height: 100%;
color: #333333;
margin-top: 10px;
white-space: nowrap;
}
}
}
......
......@@ -6,7 +6,7 @@ import UploadVideo from './UploadVideo.vue'
const emit = defineEmits<Emits>()
let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { children: 'children', label: 'category_name', value: 'id' }
const closeStatus = ref(true)
const form = reactive({
source_id: '',
name: '0',
......@@ -26,7 +26,9 @@ const handleConfirm = () => {
emit('update')
}
const handleCancel = () => {
emit('update:isShowBatchImport', false)
if (closeStatus.value !== false) {
emit('update:isShowBatchImport', false)
}
}
// 上传视频成功
const uploadVideo = (data: any) => {
......@@ -42,6 +44,9 @@ const uploadVideo = (data: any) => {
ElMessage.success('视频上传成功')
})
}
const handleClose = (val: any) => {
closeStatus.value = val.closeStatus
}
</script>
<template>
<el-dialog :model-value="isShowBatchImport" title="批量导入视频" :before-close="handleCancel">
......@@ -59,7 +64,7 @@ const uploadVideo = (data: any) => {
/>
</el-form-item>
<el-form-item label="视频文件" prop="source_id" v-if="form.classification !== ''">
<UploadVideo @upload="uploadVideo" />
<UploadVideo @upload="uploadVideo" @canClose="handleClose" />
</el-form-item>
<el-form-item label="视频名称" prop="name">
<el-radio-group v-model="form.name">
......@@ -69,8 +74,9 @@ const uploadVideo = (data: any) => {
</el-form>
<template #footer>
<span>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<el-button @click="handleCancel">取消</el-button>
{{ closeStatus }}
<el-button type="primary" @click="handleConfirm" :disabled="closeStatus === false">保存</el-button>
<el-button @click="handleCancel" :disabled="closeStatus === false">取消</el-button>
</span>
</template>
</el-dialog>
......
<script setup lang="ts">
import VideoDetail from './VideoDetail.vue'
import { getCreateAuth, updateAuth } from '@/api/base'
import { ElMessage } from 'element-plus'
const idShowMore = ref(false)
const props = defineProps({
createFlag: {
type: Number
......@@ -21,7 +23,7 @@ interface IUpload {
let uploadData = $ref<IUpload>({ code: -1 })
let uploadData1 = $ref<IUpload[]>([])
const emit = defineEmits(['upload'])
const emit = defineEmits(['upload', 'canClose'])
const form: any = reactive({
timeout: '',
partSize: '',
......@@ -52,6 +54,7 @@ const fileChange = (e: any) => {
form.uploader.addFile(form.file, null, null, null, userData)
form.uploader.startUpload()
} else {
console.log(e.target.files)
form.file = e.target.files
form.file.forEach((item: any) => {
if (item.name.indexOf('.mp4') === -1) {
......@@ -66,6 +69,7 @@ const fileChange = (e: any) => {
setTimeout(() => {
form.uploader = createUploader()
form.uploader.addFile(item, null, null, null, userData)
console.log(userData)
form.uploader.startUpload()
}, 1000)
}
......@@ -86,7 +90,9 @@ const createUploader: any = () => {
userId: form.userId,
// 开始上传
onUploadstarted: function (uploadInfo: any) {
console.log(window.localStorage.fileData)
const fileData = JSON.parse(window.localStorage.fileData || '{}')
console.log(fileData.sourceId)
// 判断有没有上传过
const isFile = !!fileData.sourceId
if (!isFile) {
......@@ -107,6 +113,7 @@ const createUploader: any = () => {
)
})
} else {
console.log(fileData, uploadInfo)
// 上传过判断一下上次上传的文件和本次上传的文件一不一样,一样的话继续上传
if (fileData.fileName === uploadInfo.file.name && fileData.fileSize === uploadInfo.file.size) {
uploader.setUploadAuthAndAddress(uploadInfo, fileData.uploadAuth, fileData.uploadAddress, fileData.videoId)
......@@ -128,12 +135,12 @@ const createUploader: any = () => {
msg: '开始上传'
}
} else {
// id.value = id.value + 1
uploadData1.push({
code: 1,
name: uploadInfo.file.name,
msg: '开始上传'
})
emit('canClose', { closeStatus: false })
}
},
// 文件上传成功
......@@ -156,6 +163,7 @@ const createUploader: any = () => {
}
}
emit('upload', { videoId: fileData.videoId, name: uploadInfo.file.name })
emit('canClose', { closeStatus: true })
},
// 文件上传失败
// code:any, message:any
......@@ -183,7 +191,8 @@ const createUploader: any = () => {
if (props.createFlag === 1) {
uploadData.progress = progressPercent
} else {
uploadData1.map((item: any) => (item.progress = progressPercent))
const findIndex = uploadData1.findIndex(item => item.name === uploadInfo.file.name)
uploadData1[findIndex].progress = progressPercent
}
},
// 上传凭证超时
......@@ -204,6 +213,9 @@ const createUploader: any = () => {
})
return uploader
}
const handleView = () => {
idShowMore.value = true
}
</script>
<template>
<div v-if="props.createFlag === 1">
......@@ -233,7 +245,7 @@ const createUploader: any = () => {
</div>
<div class="tips">推荐视频格式:帧率为25fps\输出码率为4M\输出格式为mp4,建议采用格式工厂等工具处理后上传。</div>
<div v-for="(item, index) in uploadData1" :key="index" style="display: flex; flex-direction: column">
<div v-for="(item, index) in uploadData1.slice(0, 3)" :key="index" style="display: flex; flex-direction: column">
<div class="demo-progress" v-if="item.code === 1">
<span style="min-width: 340px">{{ item.name }}</span>
<el-progress style="width: 200px" :percentage="item.progress" />
......@@ -242,11 +254,15 @@ const createUploader: any = () => {
<div class="name">上传失败(请重新选择文件进行上传)</div>
</div>
<div class="video-info" v-if="item.code === 0">
<div class="name">{{ item.name }}</div>
<div class="name1">{{ item.name }}</div>
</div>
</div>
<el-link type="primary" v-if="uploadData1.length > 3" @click="handleView"
>{{ uploadData1.length }}个文件,查看更多</el-link
>
</div>
</div>
<VideoDetail :videoList="uploadData1" v-model:idShowMore="idShowMore" v-if="idShowMore === true" />
</template>
<style lang="scss">
.demo-progress {
......@@ -294,6 +310,11 @@ const createUploader: any = () => {
font-size: 16px;
line-height: 100%;
}
.name1 {
color: #aa1941;
font-size: 14px;
line-height: 1.5;
}
.view {
font-size: 16px;
line-height: 100%;
......
<script lang="ts" setup>
const emit = defineEmits<Emits>()
const props = defineProps<Props>()
const currentPage = ref(1)
const page = reactive({
size: 10,
currentPage: 1
})
interface IUpload {
id?: number
code: number
name?: string
msg?: string
progress?: number
videoId?: string
}
interface Props {
idShowMore: boolean
videoList: IUpload[]
}
interface Emits {
(e: 'update:idShowMore', isShowBatchImport: boolean): void
}
const handleCancel = () => {
emit('update:idShowMore', false)
}
const handleSizeChange = (val: any) => {
page.size = val
}
const handleCurrentChange = (val: any) => {
page.currentPage = val
}
</script>
<template>
<el-dialog :model-value="idShowMore" title="更多视频文件" :before-close="handleCancel">
<div
v-for="(item, index) in props.videoList.slice((page.currentPage - 1) * page.size, page.currentPage * page.size)"
:key="index"
>
{{ item.name }}
</div>
<el-pagination
v-model:currentPage="currentPage"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[5, 10, 20, 30, 50]"
:total="props.videoList.length"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
</el-pagination>
</el-dialog>
</template>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论