|
@@ -3,7 +3,16 @@
|
|
|
<a-form-item label="课时名称:" name="title" required>
|
|
<a-form-item label="课时名称:" name="title" required>
|
|
|
<a-input v-model:value="form.title" placeholder="输入内容"/>
|
|
<a-input v-model:value="form.title" placeholder="输入内容"/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="选择视频:" required name="video">
|
|
|
|
|
|
|
+ <a-form-item label="知识点" name="knowledgeIds">
|
|
|
|
|
+ <a-select mode="multiple" v-model:value="form.knowledgeIds" placeholder="请选择知识点"
|
|
|
|
|
+ style="width: 220px; ">
|
|
|
|
|
+ <a-select-option v-for="(item, index) in knowledgeOptions" :key="index" :value="item.value">{{
|
|
|
|
|
+ item.label
|
|
|
|
|
+ }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="选择资源:" required name="video">
|
|
|
<div class="video-select-row">
|
|
<div class="video-select-row">
|
|
|
<a-button type="primary" @click="()=>{emit('handlerSelect')}">选择资源</a-button>
|
|
<a-button type="primary" @click="()=>{emit('handlerSelect')}">选择资源</a-button>
|
|
|
<a-button type="primary" @click="()=>{emit('handlerUpSelect')}">新上传资源</a-button>
|
|
<a-button type="primary" @click="()=>{emit('handlerUpSelect')}">新上传资源</a-button>
|
|
@@ -36,12 +45,13 @@ import UpLoadDoc from '@/components/UpLoadDoc/index.vue'
|
|
|
import UpLoadSrt from '@/components/UpLoadSrt/index.vue'
|
|
import UpLoadSrt from '@/components/UpLoadSrt/index.vue'
|
|
|
import FileName from './fileName.vue'
|
|
import FileName from './fileName.vue'
|
|
|
import {add, detail} from '@/api/hour/index'
|
|
import {add, detail} from '@/api/hour/index'
|
|
|
|
|
+import tool from "@/utils/tool";
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
visible: Boolean
|
|
visible: Boolean
|
|
|
})
|
|
})
|
|
|
const emit = defineEmits(['update:visible', 'ok', 'handlerUpSelect', 'handlerNewSelect','handlerEx','handlerExs'])
|
|
const emit = defineEmits(['update:visible', 'ok', 'handlerUpSelect', 'handlerNewSelect','handlerEx','handlerExs'])
|
|
|
-
|
|
|
|
|
|
|
+const knowledgeOptions = tool.dictList('knowledge')
|
|
|
const fileNameRef = ref(null)
|
|
const fileNameRef = ref(null)
|
|
|
const upLoadImgRef = ref(null)
|
|
const upLoadImgRef = ref(null)
|
|
|
const upLoadDocRef = ref(null)
|
|
const upLoadDocRef = ref(null)
|
|
@@ -57,7 +67,8 @@ const form = reactive({
|
|
|
video: '',
|
|
video: '',
|
|
|
coverUrl: '',
|
|
coverUrl: '',
|
|
|
docUrl: '',
|
|
docUrl: '',
|
|
|
- srtUrl: ''
|
|
|
|
|
|
|
+ srtUrl: '',
|
|
|
|
|
+ knowledgeIds : []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const rules = {
|
|
const rules = {
|
|
@@ -66,6 +77,7 @@ const rules = {
|
|
|
coverUrl: [{required: true, message: '请上传封面'}],
|
|
coverUrl: [{required: true, message: '请上传封面'}],
|
|
|
docUrl: [{required: true, message: '请上传讲义'}],
|
|
docUrl: [{required: true, message: '请上传讲义'}],
|
|
|
srtUrl: [{required: true, message: '请上传字幕'}],
|
|
srtUrl: [{required: true, message: '请上传字幕'}],
|
|
|
|
|
+ knowledgeIds: [{required: true, message: '请选择知识点', trigger: 'blur'}],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -96,6 +108,7 @@ const getData = (callBack) => {
|
|
|
let data = {}
|
|
let data = {}
|
|
|
|
|
|
|
|
data.name = form.title
|
|
data.name = form.title
|
|
|
|
|
+ data.knowledgeIds = form.knowledgeIds
|
|
|
data.courseRelates = []
|
|
data.courseRelates = []
|
|
|
//todo :0封面 1视频资源,2讲义,3字幕,4作业,5测验
|
|
//todo :0封面 1视频资源,2讲义,3字幕,4作业,5测验
|
|
|
data.courseRelates.push({funcType: 0, relateId: form.coverUrl})
|
|
data.courseRelates.push({funcType: 0, relateId: form.coverUrl})
|
|
@@ -143,6 +156,7 @@ const reset = () => {
|
|
|
form.coverUrl = ''
|
|
form.coverUrl = ''
|
|
|
form.docUrl = ''
|
|
form.docUrl = ''
|
|
|
form.srtUrl = ''
|
|
form.srtUrl = ''
|
|
|
|
|
+ form.courseRelates = []
|
|
|
|
|
|
|
|
upLoadImgRef.value.setData({id: "", url: ""})
|
|
upLoadImgRef.value.setData({id: "", url: ""})
|
|
|
fileNameRef.value.setData({id: "", name: ""})
|
|
fileNameRef.value.setData({id: "", name: ""})
|
|
@@ -169,6 +183,9 @@ const edit = (item) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
let data = res.data
|
|
let data = res.data
|
|
|
form.title = data.name
|
|
form.title = data.name
|
|
|
|
|
+ form.knowledgeIds = data.knowledgeIds
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
for (let i = 0; i < data.courseRelates.length; i++) {
|
|
for (let i = 0; i < data.courseRelates.length; i++) {
|
|
|
let itemi = data.courseRelates[i]
|
|
let itemi = data.courseRelates[i]
|
|
|
console.log('每条数据', itemi)
|
|
console.log('每条数据', itemi)
|