+
+
+
+
+
+
+
+
+
+
+
+
+
+
免费
@@ -14,14 +33,11 @@
-
-
+
+
-
-
-
-
-
+
+
@@ -49,8 +65,10 @@ import editor from '../../components/Editor'
import yamedit from '@/components/YamlEdit'
import MaterialList from '@/components/material'
import UeditorWrap from 'vue-ueditor-wrap';
+import fileUpload from '@/components/file-upload';
+import { initData } from '@/api/data'
export default {
- components: { editor, picUpload, yamedit, MaterialList, UeditorWrap },
+ components: { editor, picUpload, yamedit, MaterialList, UeditorWrap,fileUpload },
// props: {
// isAdd: {
// type: Boolean,
@@ -63,6 +81,7 @@ export default {
form: {
id: '',
cid: '',
+ categoryId:'',
chargeType:0,
articleCharge:'',
level:'',
@@ -93,12 +112,14 @@ export default {
initialFrameWidth: '100%', // 初始容器宽度
UEDITOR_HOME_URL: '/UEditor/',
serverUrl: ''
- }
+ },
+ categoryList:[]
}
},
watch: {
},
created() {
+ this.getCategory();
this.form.id = this.$route.params.id
this.$nextTick(() => {
//this.init()
@@ -112,6 +133,50 @@ export default {
})
},
methods: {
+ audioInput(file){
+ this.form.audio = file;
+ // console.log('file',file)
+ },
+ audioChange(file){
+ this.form.audio = '';
+ // console.log('remove',file)
+ },
+ videoInput(file){
+ this.form.video = file;
+ // console.log('file',file)
+ },
+ videoChange(file){
+ this.form.video = '';
+ // console.log('remove',file)
+ },
+ getCategory(){
+ initData('/api/CourseCategory',this.getQueryParams()).then((res)=>{
+ // console.log(res)
+ res.content.forEach((item)=>{
+ item.label = item.categoryName
+ item.value = item.id
+ item.children = item.categoryList
+ item.categoryList.forEach((child)=>{
+ child.label = child.categoryName
+ child.value = child.id
+ child.children = child.categoryList
+ })
+ })
+ this.categoryList = res.content
+ })
+ },
+ getQueryParams: function() {
+ return {
+ page: 1,
+ size: 10,
+ sort: ['id,desc'],
+ }
+ },
+ handleChange(value){
+ console.log(value)
+ this.form.categoryId = value[value.length-1];
+ this.form.cid = value[value.length-1];
+ },
addCustomDialog () {
window.UE.registerUI('yshop', function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({
@@ -194,6 +259,7 @@ export default {
id: '',
cid: '',
chargeType:0,
+ categoryId:'',
articleCharge:'',
level:'',
title: '',