Browse Source

2021年6月11日19:01:07

master
杨豪 4 years ago
parent
commit
2303f273b1
  1. 2
      src/components/Crud/UD.operation.vue
  2. 2
      src/components/file-upload/index.vue
  3. 2
      src/views/course/addStudy.vue
  4. 14
      src/views/course/studyList.vue
  5. 84
      src/views/wechat/article/form.vue

2
src/components/Crud/UD.operation.vue

@ -5,7 +5,7 @@
<p>{{ msg }}</p> <p>{{ msg }}</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="doCancel">取消</el-button> <el-button size="mini" type="text" @click="doCancel">取消</el-button>
<el-button :loading="crud.dataStatus[data.id].delete === 2" type="primary" size="mini" @click="crud.doDelete(data)">确定</el-button> <el-button type="primary" size="mini" @click="crud.doDelete(data)">确定</el-button>
</div> </div>
<el-button slot="reference" :disabled="disabledDle" type="danger" icon="el-icon-delete" size="mini" @click="toDelete" /> <el-button slot="reference" :disabled="disabledDle" type="danger" icon="el-icon-delete" size="mini" @click="toDelete" />
</el-popover> </el-popover>

2
src/components/file-upload/index.vue

@ -43,7 +43,7 @@ export default {
res.push({ name: this.value, url: this.resourcesUrl + this.value, response: this.value }) res.push({ name: this.value, url: this.resourcesUrl + this.value, response: this.value })
} }
this.$emit('input', this.value) this.$emit('input', this.value)
console.log('res' + res) // console.log('res' + res)
return res return res
} }
}, },

2
src/views/course/addStudy.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px">
<el-form-item label="分类"> <el-form-item label="课程分类">
<el-cascader <el-cascader
v-model="form.categoryId" v-model="form.categoryId"
:options="categoryList" :options="categoryList"

14
src/views/course/studyList.vue

@ -17,7 +17,7 @@
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" /> <el-table-column v-if="columns.visible('id')" prop="id" label="id" />
<el-table-column v-if="columns.visible('categoryName')" prop="categoryName" label="分类" /> <el-table-column v-if="columns.visible('categoryName')" prop="categoryName" label="课程分类" />
<el-table-column v-if="columns.visible('courseStartTime')" prop="courseStartTime" label="打榜时间" :show-overflow-tooltip="true"> <el-table-column v-if="columns.visible('courseStartTime')" prop="courseStartTime" label="打榜时间" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.listStartTime)}} ~ {{parseTime(scope.row.listEndTime)}}</span> <span>{{ parseTime(scope.row.listStartTime)}} ~ {{parseTime(scope.row.listEndTime)}}</span>
@ -49,22 +49,22 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('integral')" prop="integral" label="奖惩积分" /> <el-table-column v-if="columns.visible('integral')" prop="integral" label="奖惩积分" />
<el-table-column label="操作" width="150px" align="center"> <el-table-column label="操作" width="170px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit"> <el-button size="mini" type="primary" icon="el-icon-edit">
<router-link :to="'/course/addStudy/'+scope.row.id">编辑</router-link> <router-link :to="'/course/addStudy/'+scope.row.id">编辑</router-link>
</el-button> </el-button>
<el-popover <el-popover
:ref="scope.row.id" :ref="scope.row.id"
placement="top" placement="top"
width="180" width="180"
> >
<p>确定删除本条数据吗</p> <p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button type="primary" size="mini" @click="crud.doDelete(scope.row)">确定</el-button> <el-button type="primary" size="mini" @click="crud.doDelete(scope.row)">确定</el-button>
</div> </div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>

84
src/views/wechat/article/form.vue

@ -1,6 +1,25 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="标题">
<el-input v-model="form.title" style="width: 370px;" />
</el-form-item>
<el-form-item label="作者">
<el-input v-model="form.author" style="width: 370px;" />
</el-form-item>
<el-form-item label="封面">
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="文章分类">
<el-cascader
v-model="form.categoryId"
:options="categoryList"
:show-all-levels="false"
:props="{ checkStrictly: true }"
@change="handleChange">
</el-cascader>
</el-form-item>
<el-form-item label="收费类型" prop="chargeType"> <el-form-item label="收费类型" prop="chargeType">
<el-radio-group v-model="form.chargeType"> <el-radio-group v-model="form.chargeType">
<el-radio :label="0">免费</el-radio> <el-radio :label="0">免费</el-radio>
@ -14,14 +33,11 @@
<el-form-item label="文章等级"> <el-form-item label="文章等级">
<el-input-number v-model="form.level" :min="1" label="文章等级"></el-input-number> <el-input-number v-model="form.level" :min="1" label="文章等级"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="标题"> <el-form-item label="音频">
<el-input v-model="form.title" style="width: 370px;" /> <fileUpload v-model="form.audio" @input="audioInput" @change="audioChange"></fileUpload>
</el-form-item> </el-form-item>
<el-form-item label="作者"> <el-form-item label="视频">
<el-input v-model="form.author" style="width: 370px;" /> <fileUpload v-model="form.video" @input="videoInput" @change="videoChange"></fileUpload>
</el-form-item>
<el-form-item label="封面">
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
</el-form-item> </el-form-item>
<el-form-item label="简介"> <el-form-item label="简介">
<el-input v-model="form.synopsis" style="width: 370px;" rows="5" type="textarea" /> <el-input v-model="form.synopsis" style="width: 370px;" rows="5" type="textarea" />
@ -49,8 +65,10 @@ import editor from '../../components/Editor'
import yamedit from '@/components/YamlEdit' import yamedit from '@/components/YamlEdit'
import MaterialList from '@/components/material' import MaterialList from '@/components/material'
import UeditorWrap from 'vue-ueditor-wrap'; import UeditorWrap from 'vue-ueditor-wrap';
import fileUpload from '@/components/file-upload';
import { initData } from '@/api/data'
export default { export default {
components: { editor, picUpload, yamedit, MaterialList, UeditorWrap }, components: { editor, picUpload, yamedit, MaterialList, UeditorWrap,fileUpload },
// props: { // props: {
// isAdd: { // isAdd: {
// type: Boolean, // type: Boolean,
@ -63,6 +81,7 @@ export default {
form: { form: {
id: '', id: '',
cid: '', cid: '',
categoryId:'',
chargeType:0, chargeType:0,
articleCharge:'', articleCharge:'',
level:'', level:'',
@ -93,12 +112,14 @@ export default {
initialFrameWidth: '100%', // initialFrameWidth: '100%', //
UEDITOR_HOME_URL: '/UEditor/', UEDITOR_HOME_URL: '/UEditor/',
serverUrl: '' serverUrl: ''
} },
categoryList:[]
} }
}, },
watch: { watch: {
}, },
created() { created() {
this.getCategory();
this.form.id = this.$route.params.id this.form.id = this.$route.params.id
this.$nextTick(() => { this.$nextTick(() => {
//this.init() //this.init()
@ -112,6 +133,50 @@ export default {
}) })
}, },
methods: { 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 () { addCustomDialog () {
window.UE.registerUI('yshop', function (editor, uiName) { window.UE.registerUI('yshop', function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({ let dialog = new window.UE.ui.Dialog({
@ -194,6 +259,7 @@ export default {
id: '', id: '',
cid: '', cid: '',
chargeType:0, chargeType:0,
categoryId:'',
articleCharge:'', articleCharge:'',
level:'', level:'',
title: '', title: '',

Loading…
Cancel
Save