|
@@ -15,6 +15,7 @@ import {
|
|
|
ElRow,
|
|
|
ElTooltip
|
|
|
} from 'element-plus'
|
|
|
+import { ArrowDown } from '@element-plus/icons-vue'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import CoursePreview from '../course-preview'
|
|
|
import { createState } from '../createState'
|
|
@@ -23,6 +24,7 @@ import iconDown from '../images/icon_down.png'
|
|
|
import iconUp from '../images/icon_up.png'
|
|
|
import iconDelete from '../images/icon_delete.png'
|
|
|
import ColVideo from '@/components/col-video'
|
|
|
+import SelectMusicAlbum from '../select-music-album'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'course-content',
|
|
@@ -36,10 +38,13 @@ export default defineComponent({
|
|
|
videoTitle: '',
|
|
|
videoContent: '',
|
|
|
videoUrl: '',
|
|
|
+ relationList: [] as any,
|
|
|
coverUrl: ''
|
|
|
}
|
|
|
] as any
|
|
|
- }
|
|
|
+ },
|
|
|
+ musicStatus: false,
|
|
|
+ selectItem: {} as any // 选中的课程
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -52,6 +57,7 @@ export default defineComponent({
|
|
|
videoTitle: '',
|
|
|
videoContent: '',
|
|
|
videoUrl: item,
|
|
|
+ relationList: [] as any,
|
|
|
coverUrl: ''
|
|
|
})
|
|
|
})
|
|
@@ -68,7 +74,7 @@ export default defineComponent({
|
|
|
this.show = true
|
|
|
} else {
|
|
|
this.$nextTick(() => {
|
|
|
- let isError = document.getElementsByClassName('is-error')
|
|
|
+ const isError = document.getElementsByClassName('is-error')
|
|
|
isError[0].scrollIntoView({
|
|
|
block: 'center',
|
|
|
behavior: 'smooth'
|
|
@@ -81,7 +87,7 @@ export default defineComponent({
|
|
|
async createSubmit() {
|
|
|
try {
|
|
|
const videoDetail = createState.lessonGroup
|
|
|
- let params = {
|
|
|
+ const params = {
|
|
|
lessonList: createState.lessonList,
|
|
|
lessonGroup: {
|
|
|
...videoDetail,
|
|
@@ -102,11 +108,21 @@ export default defineComponent({
|
|
|
}
|
|
|
sessionStorage.setItem('videoActiveName', 'DOING')
|
|
|
this.$router.back()
|
|
|
- } catch {}
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
swapItems(arr: any, index1: number, index2: number) {
|
|
|
arr[index1] = arr.splice(index2, 1, arr[index1])[0]
|
|
|
return arr
|
|
|
+ },
|
|
|
+ getName(item: any) {
|
|
|
+ const relation =
|
|
|
+ item.relationList.length > 0 ? item.relationList[0] : null
|
|
|
+ return relation
|
|
|
+ ? (relation.relationMusicAlbum === 'ALBUM' ? '专辑:' : '曲目:') +
|
|
|
+ relation.musicAlbumName
|
|
|
+ : ''
|
|
|
}
|
|
|
},
|
|
|
render() {
|
|
@@ -115,7 +131,7 @@ export default defineComponent({
|
|
|
<ElForm
|
|
|
class="px-6 pb-10 pt-7 min-h-[280px]"
|
|
|
size="large"
|
|
|
- labelWidth={'120px'}
|
|
|
+ labelWidth={'140px'}
|
|
|
labelPosition="left"
|
|
|
ref="form"
|
|
|
model={createState}
|
|
@@ -239,23 +255,17 @@ export default defineComponent({
|
|
|
</ElFormItem>
|
|
|
<ElRow>
|
|
|
<ElCol span={12}>
|
|
|
- {/* <ElFormItem label={`第${index + 1}课`}> */}
|
|
|
<ElFormItem label="课程视频" required>
|
|
|
- {/* <ColUploadVideo
|
|
|
- v-model:modelValue={item.videoUrl}
|
|
|
- disabled
|
|
|
- /> */}
|
|
|
<ColVideo
|
|
|
styleValue={{ with: '150px', height: '85px' }}
|
|
|
controls={false}
|
|
|
src={item.videoUrl}
|
|
|
- // progress={false}
|
|
|
volume={false}
|
|
|
/>
|
|
|
<p></p>
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
- <ElCol span={10}>
|
|
|
+ <ElCol span={11}>
|
|
|
<ElFormItem
|
|
|
label="视频封面"
|
|
|
prop={`lessonList.${index}.coverUrl`}
|
|
@@ -268,6 +278,25 @@ export default defineComponent({
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
</ElRow>
|
|
|
+ <ElFormItem
|
|
|
+ label="关联曲目或专辑"
|
|
|
+ prop={`lessonList.${index}.relationList`}
|
|
|
+ onClick={() => {
|
|
|
+ this.selectItem = item
|
|
|
+ this.musicStatus = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div class={styles.relationList}></div>
|
|
|
+ <ElInput
|
|
|
+ placeholder="请选择关联曲目或专辑"
|
|
|
+ // v-model={item.videoContent}
|
|
|
+ modelValue={
|
|
|
+ item.relationList.length > 0 ? this.getName(item) : ''
|
|
|
+ }
|
|
|
+ readonly
|
|
|
+ suffixIcon={ArrowDown}
|
|
|
+ />
|
|
|
+ </ElFormItem>
|
|
|
</div>
|
|
|
))}
|
|
|
</ElForm>
|
|
@@ -296,6 +325,7 @@ export default defineComponent({
|
|
|
{/* @ts-ignore */}
|
|
|
<ElDialog
|
|
|
v-model={this.show}
|
|
|
+ width={375}
|
|
|
title="预览"
|
|
|
v-slots={{
|
|
|
footer: () => (
|
|
@@ -323,6 +353,26 @@ export default defineComponent({
|
|
|
>
|
|
|
<CoursePreview />
|
|
|
</ElDialog>
|
|
|
+
|
|
|
+ <ElDialog v-model={this.musicStatus} title="选择曲目或专辑" width={750}>
|
|
|
+ <SelectMusicAlbum
|
|
|
+ subjectIds={createState.lessonGroup.lessonSubject}
|
|
|
+ onSelect={(item: any) => {
|
|
|
+ this.musicStatus = false
|
|
|
+ this.selectItem.relationList = [
|
|
|
+ {
|
|
|
+ musicAlbumId: item.id,
|
|
|
+ musicAlbumName:
|
|
|
+ item.selectType === 'ALBUM'
|
|
|
+ ? item.albumName
|
|
|
+ : item.musicSheetName,
|
|
|
+ relationMusicAlbum: item.selectType,
|
|
|
+ useRelationType: 'RECOMMEND'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </ElDialog>
|
|
|
</div>
|
|
|
)
|
|
|
}
|