Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-master-html
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Various Dev Server settings
|
// Various Dev Server settings
|
||||||
host: '192.168.110.157', // can be overwritten by process.env.HOST
|
host: '192.168.110.162', // can be overwritten by process.env.HOST
|
||||||
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||||
autoOpenBrowser: true,
|
autoOpenBrowser: true,
|
||||||
errorOverlay: true,
|
errorOverlay: true,
|
||||||
|
|||||||
98
src/components/imgPrev.vue
Normal file
98
src/components/imgPrev.vue
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 图片预览 -->
|
||||||
|
<div id="modal" class="modal">
|
||||||
|
<span class="close" @click="close">×</span>
|
||||||
|
<img class="modal-content" :src="url">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props:['url'],
|
||||||
|
methods:{
|
||||||
|
close(){
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.zoomable {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 模态框 */
|
||||||
|
.modal {
|
||||||
|
/* display: none; */
|
||||||
|
display: flex; align-items: center;
|
||||||
|
position: fixed;
|
||||||
|
/* 确保层级在上 */
|
||||||
|
z-index: 1;
|
||||||
|
padding-top: 100px;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
margin: auto;
|
||||||
|
display: block; background: #fff;
|
||||||
|
/* width: 80%; */
|
||||||
|
max-width: 700px;
|
||||||
|
max-height: 80vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
-webkit-animation-name: zoom;
|
||||||
|
-webkit-animation-duration: 0.6s;
|
||||||
|
animation-name: zoom;
|
||||||
|
animation-duration: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes zoom {
|
||||||
|
from {
|
||||||
|
-webkit-transform: scale(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
-webkit-transform: scale(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes zoom {
|
||||||
|
from {
|
||||||
|
transform: scale(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
transform: scale(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 关闭按钮 */
|
||||||
|
.close {
|
||||||
|
position: absolute;
|
||||||
|
top: 15%;
|
||||||
|
right: 35px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 40px;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close:hover,
|
||||||
|
.close:focus {
|
||||||
|
color: #14b3e4;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -64,6 +64,8 @@ const mainRoutes = {
|
|||||||
{ path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } },
|
{ path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } },
|
||||||
{ path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } },
|
{ path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } },
|
||||||
{ path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } },
|
{ path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } },
|
||||||
|
{ path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } },
|
||||||
|
{ path: '/workOrder', component: _import('modules/workOrderLIst'), name: 'workOrder', meta: { title: '工单列表', isTab: true } },
|
||||||
],
|
],
|
||||||
beforeEnter (to, from, next) {
|
beforeEnter (to, from, next) {
|
||||||
let token = Vue.cookie.get('token')
|
let token = Vue.cookie.get('token')
|
||||||
|
|||||||
25
src/utils/imgPre.js
Normal file
25
src/utils/imgPre.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
var modal = document.getElementById("modal");
|
||||||
|
|
||||||
|
var modalImg = document.getElementById("modalImage");
|
||||||
|
|
||||||
|
var images = document.querySelectorAll(".zoomable");
|
||||||
|
|
||||||
|
// 遍历为每个图片元素添加事件监听器
|
||||||
|
images.forEach(function (image) {
|
||||||
|
image.addEventListener("click", function () {
|
||||||
|
modal.style.display = "block";
|
||||||
|
modalImg.src = this.src;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var span = document.querySelector(".close");
|
||||||
|
|
||||||
|
span.addEventListener("click", function () {
|
||||||
|
modal.style.display = "none";
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.addEventListener("click", function (event) {
|
||||||
|
if (event.target == modal) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 修改密码
|
// 修改密码
|
||||||
updatePasswordHandle () {
|
updatePasswordHandle () {
|
||||||
this.updatePassowrdVisible = true
|
this.updatePassowrdVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
@@ -36,12 +36,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="视频">
|
<el-form-item label="视频" v-loading="VideoLoadingFlag">
|
||||||
<el-upload :limit="1" class="el-uploadvideo " v-loading="videoLoading" element-loading-text="正在保存到服务器,请勿离开..."
|
<el-upload :limit="1" class="el-uploadvideo " v-loading="videoLoading" element-loading-text="正在保存到服务器,请勿离开..."
|
||||||
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)"
|
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)"
|
||||||
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
||||||
:action="baseUrl + '/oss/fileoss'" :file-list="videoList" :on-success="videoSuccess" accept=".mp4"
|
:action="baseUrl + '/oss/fileoss'" :file-list="videoList"
|
||||||
:on-remove="videoRemove" :show-file-list="true" :on-progress="uploadVideo">
|
:on-error="onvideoEror"
|
||||||
|
:before-upload="beforeuploadVideo"
|
||||||
|
:on-success="videoSuccess" accept=".mp4"
|
||||||
|
:on-remove="videoRemove" :show-file-list="true">
|
||||||
<!-- <i class="el-icon-plus"></i> -->
|
<!-- <i class="el-icon-plus"></i> -->
|
||||||
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
|
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -161,7 +164,7 @@
|
|||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
VideoLoadingFlag:false,
|
||||||
// 富文本编辑器配置
|
// 富文本编辑器配置
|
||||||
editorOption: {
|
editorOption: {
|
||||||
modules: {
|
modules: {
|
||||||
@@ -462,7 +465,22 @@
|
|||||||
// setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条
|
// setTimeout( () => {this.progressFlag = false}, 1000) // 一秒后关闭进度条
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 上传失败
|
||||||
|
onvideoEror(err, file, fileList){
|
||||||
|
console.log(err,'err')
|
||||||
|
this.VideoLoadingFlag = false
|
||||||
|
// this.$message.error('上传失败')
|
||||||
|
this.$notify.error({
|
||||||
|
title: '错误',
|
||||||
|
message: '上传失败',
|
||||||
|
duration: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 视频上传成功前
|
||||||
|
beforeuploadVideo(){
|
||||||
|
this.VideoLoadingFlag = true
|
||||||
|
},
|
||||||
videoSuccess(res, file) {
|
videoSuccess(res, file) {
|
||||||
console.log(res, 'res')
|
console.log(res, 'res')
|
||||||
if (res.msg == "success") {
|
if (res.msg == "success") {
|
||||||
@@ -483,6 +501,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$message.error("上传失败");
|
this.$message.error("上传失败");
|
||||||
}
|
}
|
||||||
|
this.VideoLoadingFlag = false
|
||||||
},
|
},
|
||||||
|
|
||||||
videoRemove(file, fileList) {
|
videoRemove(file, fileList) {
|
||||||
|
|||||||
@@ -66,7 +66,6 @@
|
|||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
active-text="是"
|
active-text="是"
|
||||||
inactive-text="否"
|
inactive-text="否"
|
||||||
|
|
||||||
>
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -91,8 +90,57 @@
|
|||||||
>
|
>
|
||||||
</quill-editor>
|
</quill-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item prop="sort" label-width="0"> -->
|
||||||
|
<!-- <div v-if="this.dataForm.id"> -->
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="flexbox videoBox"
|
||||||
|
v-for="(item, index) in video_audio_url"
|
||||||
|
:key="index"
|
||||||
|
|
||||||
|
>
|
||||||
|
<div style="width:120px">视频/音频ID:</div>
|
||||||
|
<div style="width:250px; margin-right:10px; margin-left:10px">
|
||||||
|
<el-input
|
||||||
|
style=""
|
||||||
|
v-model="item.video"
|
||||||
|
placeholder="请输入视频/音频ID"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="flexbox" style="align-items:center;" >
|
||||||
|
<span style="display:inline-block; width:60px">排序:</span>
|
||||||
|
<el-input
|
||||||
|
style=""
|
||||||
|
v-model="item.sort"
|
||||||
|
placeholder="排序"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
|
<div style="margin-right:10px; height:38px">
|
||||||
|
<el-form-item label="加密类型:" prop="type" label-width="100px">
|
||||||
|
<el-select
|
||||||
|
v-model="item.type"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in typeList"
|
||||||
|
:key="item.dictType"
|
||||||
|
:label="item.dictValue"
|
||||||
|
:value="item.dictType"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-button @click="delItem(index)" plain type="danger" size="mini">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- </el-form-item> -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="text-align:center; padding-top:15px" >
|
||||||
|
<el-button @click="addItem">添加一条音/视频</el-button>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handlereset">取消</el-button>
|
<el-button @click="handlereset">取消</el-button>
|
||||||
@@ -169,6 +217,21 @@ export default {
|
|||||||
dictType: "",
|
dictType: "",
|
||||||
dictValue: ""
|
dictValue: ""
|
||||||
},
|
},
|
||||||
|
typeList: [
|
||||||
|
//类型0普通1加密
|
||||||
|
{
|
||||||
|
dictType: 0,
|
||||||
|
dictValue: "普通"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "加密"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "mp3"
|
||||||
|
}
|
||||||
|
],
|
||||||
gushuList: [],
|
gushuList: [],
|
||||||
authorList: [],
|
authorList: [],
|
||||||
restaurants: [],
|
restaurants: [],
|
||||||
@@ -185,10 +248,18 @@ export default {
|
|||||||
title: "",
|
title: "",
|
||||||
imgUrl: "",
|
imgUrl: "",
|
||||||
content: "",
|
content: "",
|
||||||
sort: 1
|
sort: 1,
|
||||||
|
// video_audio_url: [
|
||||||
|
// {url:'454545',type:0}
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
|
video_audio_url: [
|
||||||
|
{ video: "" ,type:1,id:0,sort:0}
|
||||||
|
],
|
||||||
|
obj:{ video: "" ,type:1,id:0,sort:0},
|
||||||
splitsTypeList: [],
|
splitsTypeList: [],
|
||||||
dataRule: {}
|
dataRule: {},
|
||||||
|
chapterId:null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -197,6 +268,16 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
delItem(index){
|
||||||
|
this.video_audio_url.splice(index, 1)
|
||||||
|
// console.log(this.video_audio_url,'删除后的')
|
||||||
|
},
|
||||||
|
addItem() {
|
||||||
|
// var jj = {...this.obj}
|
||||||
|
console.log(this.video_audio_url.length,'this.dataForm.video_audio_url--------')
|
||||||
|
this.video_audio_url.push({'chapterId':this.chapterId, ...this.obj});
|
||||||
|
console.log(this.video_audio_url,'this.dataForm.video_audio_url')
|
||||||
|
},
|
||||||
contentUploadSuccess(res, file) {
|
contentUploadSuccess(res, file) {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
let quill = this.$refs.myQuillEditor.quill;
|
let quill = this.$refs.myQuillEditor.quill;
|
||||||
@@ -231,6 +312,13 @@ export default {
|
|||||||
this.dataForm.courseId = courseid ? courseid : "";
|
this.dataForm.courseId = courseid ? courseid : "";
|
||||||
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
this.dataForm.catalogueId = catalogue_id ? catalogue_id : "";
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
this.chapterId = this.dataForm.id
|
||||||
|
if(this.dataForm.videoList && this.dataForm.videoList.length > 0){
|
||||||
|
this.video_audio_url = [...this.dataForm.videoList]
|
||||||
|
console.log('dedao',this.video_audio_url)
|
||||||
|
}else{
|
||||||
|
this.video_audio_url = []
|
||||||
|
}
|
||||||
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
||||||
var img = {
|
var img = {
|
||||||
name: "",
|
name: "",
|
||||||
@@ -265,9 +353,11 @@ export default {
|
|||||||
content: this.dataForm.content,
|
content: this.dataForm.content,
|
||||||
sort: this.dataForm.sort,
|
sort: this.dataForm.sort,
|
||||||
isAudition: this.dataForm.isAudition,
|
isAudition: this.dataForm.isAudition,
|
||||||
|
videoList:this.video_audio_url,
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
|
// this.video_audio_url = []
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "操作成功",
|
message: "操作成功",
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -303,7 +393,8 @@ export default {
|
|||||||
console.log(file);
|
console.log(file);
|
||||||
},
|
},
|
||||||
handlereset() {
|
handlereset() {
|
||||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
// this.video_audio_url = []
|
||||||
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false),(this.video_audio_url = []);
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
@@ -343,3 +434,11 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.videoBox { width: 100%;
|
||||||
|
margin-bottom: 15px; align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -45,6 +45,43 @@
|
|||||||
<img width="100%" :src="dataForm.image" alt="" />
|
<img width="100%" :src="dataForm.image" alt="" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<div v-if="relationProducts && relationProducts.length > 0" style="margin-bottom:20px">
|
||||||
|
<el-table
|
||||||
|
:data="relationProducts"
|
||||||
|
border
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="productName"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="商品名"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="课程图"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div
|
||||||
|
v-if="scope.row.productImages"
|
||||||
|
style="width:100%;display: flex;
|
||||||
|
align-items: center;justify-content: center;"
|
||||||
|
>
|
||||||
|
<img :src="scope.row.productImages" alt="" width="40px" height="40px" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button plain type="danger" size="mini" @click="delPro(scope.$index)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div style="text-align:center; margin-bottom:15px" ><el-button @click="showProTable" size="mini" type="primary">添加关联书籍</el-button></div>
|
||||||
<el-form-item label="课程介绍" prop="sort" style="margin-bottom: 140px;">
|
<el-form-item label="课程介绍" prop="sort" style="margin-bottom: 140px;">
|
||||||
<div style="height: calc(620px - 120px)">
|
<div style="height: calc(620px - 120px)">
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -140,6 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
placeholder: "请输入正文"
|
placeholder: "请输入正文"
|
||||||
},
|
},
|
||||||
|
relationProducts :[],
|
||||||
baseUrl: global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
visible: false,
|
visible: false,
|
||||||
bookList: [
|
bookList: [
|
||||||
@@ -228,6 +266,7 @@ export default {
|
|||||||
// relationId:0,
|
// relationId:0,
|
||||||
},
|
},
|
||||||
splitsTypeList: [],
|
splitsTypeList: [],
|
||||||
|
courseId:undefined,
|
||||||
dataRule: {
|
dataRule: {
|
||||||
// name: [
|
// name: [
|
||||||
// { required: true, message: '书名不能为空', trigger: 'blur' }
|
// { required: true, message: '书名不能为空', trigger: 'blur' }
|
||||||
@@ -286,8 +325,23 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.restaurants = this.loadAll();
|
// this.restaurants = this.loadAll();
|
||||||
|
this.$bus.$on("linkList", (data) => {
|
||||||
|
console.log('获得列表',data)
|
||||||
|
if(data && data.length > 0){
|
||||||
|
this.relationProducts = this.relationProducts.concat(data)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delPro(i){
|
||||||
|
console.log('i',i)
|
||||||
|
// this.$emit('delPro',i)
|
||||||
|
this.relationProducts.splice(i,1)
|
||||||
|
console.log('处理后的',this.relationProducts)
|
||||||
|
},
|
||||||
|
showProTable(){
|
||||||
|
this.$emit('showProTable',true)
|
||||||
|
},
|
||||||
contentUploadSuccess(res, file) {
|
contentUploadSuccess(res, file) {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
let quill = this.$refs.myQuillEditor.quill;
|
let quill = this.$refs.myQuillEditor.quill;
|
||||||
@@ -319,6 +373,7 @@ export default {
|
|||||||
init(row) {
|
init(row) {
|
||||||
console.log("11111", row);
|
console.log("11111", row);
|
||||||
if (row && row.id) {
|
if (row && row.id) {
|
||||||
|
this.courseId = row.id
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: this.$http.adornUrl(this.urlList.info),
|
url: this.$http.adornUrl(this.urlList.info),
|
||||||
@@ -337,7 +392,11 @@ export default {
|
|||||||
if (res && res.data.code === 0) {
|
if (res && res.data.code === 0) {
|
||||||
var data = res.data.course;
|
var data = res.data.course;
|
||||||
console.log("data at line 357:", data);
|
console.log("data at line 357:", data);
|
||||||
|
if(res.data.shopProductList && res.data.shopProductList.length > 0){
|
||||||
|
this.relationProducts = res.data.shopProductList
|
||||||
|
}else{
|
||||||
|
this.relationProducts = []
|
||||||
|
}
|
||||||
if (data.image != "" && data.image != null) {
|
if (data.image != "" && data.image != null) {
|
||||||
var img = {
|
var img = {
|
||||||
name: "",
|
name: "",
|
||||||
@@ -365,6 +424,15 @@ export default {
|
|||||||
// this.$message.error("请选择图书类型");
|
// this.$message.error("请选择图书类型");
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
let _relationProductIds = ''
|
||||||
|
if(this.relationProducts.length > 0){
|
||||||
|
let _list = [...this.relationProducts]
|
||||||
|
_list = _list.map(item => item.productId)
|
||||||
|
_relationProductIds = _list.join()
|
||||||
|
// console.log(_relationProductIds, _list,'_relationProductIds')
|
||||||
|
}
|
||||||
|
// console.log(_relationProductIds, _list,'_relationProductIds')
|
||||||
|
|
||||||
this.$refs["dataForm"].validate(valid => {
|
this.$refs["dataForm"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
@@ -381,7 +449,8 @@ export default {
|
|||||||
title: this.dataForm.title,
|
title: this.dataForm.title,
|
||||||
sort: this.dataForm.sort,
|
sort: this.dataForm.sort,
|
||||||
image: this.dataForm.image,
|
image: this.dataForm.image,
|
||||||
content: this.dataForm.content
|
content: this.dataForm.content,
|
||||||
|
relationProductIds : _relationProductIds
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
@@ -391,6 +460,8 @@ export default {
|
|||||||
duration: 1500,
|
duration: 1500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
this.relationProductIds = []
|
||||||
|
this.relationProducts = []
|
||||||
this.$emit("refreshDataList");
|
this.$emit("refreshDataList");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -429,6 +500,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handlereset() {
|
handlereset() {
|
||||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||||
|
this.$emit('pclose')
|
||||||
|
this.relationProducts = []
|
||||||
|
this.courseId = undefined
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
|
|||||||
@@ -31,6 +31,12 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="目录名称"
|
label="目录名称"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="sort"
|
prop="sort"
|
||||||
@@ -77,7 +83,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="buyPeoples"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="购买人数"
|
||||||
|
width="80"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="sort"
|
prop="sort"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
@@ -142,6 +155,9 @@
|
|||||||
@click.native="handleCreateProduct(scope.row.id)"
|
@click.native="handleCreateProduct(scope.row.id)"
|
||||||
>创建商品</el-dropdown-item
|
>创建商品</el-dropdown-item
|
||||||
>
|
>
|
||||||
|
<el-dropdown-item @click.native="migrate(scope.row)"
|
||||||
|
>迁移本部</el-dropdown-item
|
||||||
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
@@ -158,6 +174,11 @@
|
|||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
<move-course
|
||||||
|
v-if="drawerVisible" :catalogueId="catalogueId" :catalogueTitle = "catalogueTitle"
|
||||||
|
ref="moveCourse"
|
||||||
|
@mycloseDrawer="mycloseDrawer"
|
||||||
|
></move-course>
|
||||||
<price
|
<price
|
||||||
v-if="priceVisible"
|
v-if="priceVisible"
|
||||||
ref="priceUpdate"
|
ref="priceUpdate"
|
||||||
@@ -167,6 +188,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moveCourse from "./moveCourse.vue";
|
||||||
import AddOrUpdate from "./catalogue-add-or-update";
|
import AddOrUpdate from "./catalogue-add-or-update";
|
||||||
import price from "./catalogue-price";
|
import price from "./catalogue-price";
|
||||||
export default {
|
export default {
|
||||||
@@ -181,6 +203,7 @@ export default {
|
|||||||
sociologyId: "",
|
sociologyId: "",
|
||||||
keywords: ""
|
keywords: ""
|
||||||
},
|
},
|
||||||
|
drawerVisible: false,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
delFlag: false,
|
delFlag: false,
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
@@ -192,12 +215,16 @@ export default {
|
|||||||
priceVisible: false,
|
priceVisible: false,
|
||||||
urlList: {
|
urlList: {
|
||||||
createProduct: "/master/course/createProductForCatalogue"
|
createProduct: "/master/course/createProductForCatalogue"
|
||||||
}
|
},
|
||||||
|
catalogueId:null, // 操作的目录id,
|
||||||
|
courseId:null, // 勾选的课程id,
|
||||||
|
catalogueTitle:'' //迁移的课程名称
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
price
|
price,
|
||||||
|
moveCourse
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.courseid = this.$route.query.id;
|
this.courseid = this.$route.query.id;
|
||||||
@@ -234,6 +261,30 @@ export default {
|
|||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
mycloseDrawer(val) {
|
||||||
|
console.log("999999", val);
|
||||||
|
this.drawerVisible = false;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
migrate(item) {
|
||||||
|
// 课程迁移
|
||||||
|
// console.log(item);
|
||||||
|
|
||||||
|
// this.$confirm("您正在进行课程迁移操作, 是否继续?", "提示", {
|
||||||
|
// confirmButtonText: "确定",
|
||||||
|
// cancelButtonText: "取消",
|
||||||
|
// type: "warning"
|
||||||
|
// })
|
||||||
|
// .then(() => {
|
||||||
|
this.catalogueId = item.id
|
||||||
|
this.catalogueTitle = item.title
|
||||||
|
this.drawerVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["moveCourse"].getDataList();
|
||||||
|
});
|
||||||
|
// })
|
||||||
|
// .catch(() => {});
|
||||||
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle(val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val;
|
this.pageSize = val;
|
||||||
@@ -258,7 +309,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCreateProduct(id) {
|
handleCreateProduct(id) {
|
||||||
console.log('id at line 260:', id)
|
console.log("id at line 260:", id);
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: this.$http.adornUrl(`${this.urlList.createProduct}`),
|
url: this.$http.adornUrl(`${this.urlList.createProduct}`),
|
||||||
|
|||||||
@@ -32,6 +32,12 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="章节名称"
|
label="章节名称"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<!-- <span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|||||||
@@ -67,6 +67,12 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="课程名"
|
label="课程名"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<!-- <el-table-column prop="authorName" header-align="center" align="center" label="作者姓名">
|
<!-- <el-table-column prop="authorName" header-align="center" align="center" label="作者姓名">
|
||||||
@@ -163,10 +169,7 @@
|
|||||||
width="600"
|
width="600"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div
|
<div style=" " v-if="scope.row.courseCatalogueEntityList.length == 0">
|
||||||
style=" "
|
|
||||||
v-if="scope.row.courseCatalogueEntityList.length == 0"
|
|
||||||
>
|
|
||||||
该课程还未添加目录
|
该课程还未添加目录
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -183,7 +186,6 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style="width: 90px;float: left;font-weight: 800;border: 1px solid #bbbb; border-radius: 4px;line-height: 30px;"
|
style="width: 90px;float: left;font-weight: 800;border: 1px solid #bbbb; border-radius: 4px;line-height: 30px;"
|
||||||
|
|
||||||
>
|
>
|
||||||
<!-- <el-tag type="success" > -->
|
<!-- <el-tag type="success" > -->
|
||||||
{{ v.title }}
|
{{ v.title }}
|
||||||
@@ -198,10 +200,13 @@
|
|||||||
}px);float: right;`
|
}px);float: right;`
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div v-if="v.productList.length==0">
|
<div v-if="v.productList.length == 0">
|
||||||
暂未关联商品
|
暂未关联商品
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item, i) in v.productList" v-if="v.productList.length>0">
|
<div
|
||||||
|
v-for="(item, i) in v.productList"
|
||||||
|
v-if="v.productList.length > 0"
|
||||||
|
>
|
||||||
{{ item.productName }}
|
{{ item.productName }}
|
||||||
<span style="color: #ff5b36;"
|
<span style="color: #ff5b36;"
|
||||||
>¥{{
|
>¥{{
|
||||||
@@ -252,7 +257,7 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="160"
|
width="240"
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -306,6 +311,9 @@
|
|||||||
@click="addOrUpdateHandle(scope.row)"
|
@click="addOrUpdateHandle(scope.row)"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
|
<el-button type="text" size="small" @click="showLinkTags(scope.row)"
|
||||||
|
>查看引用</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -331,12 +339,60 @@
|
|||||||
<add-or-update
|
<add-or-update
|
||||||
v-if="addOrUpdateVisible"
|
v-if="addOrUpdateVisible"
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
|
:relationProducts = relationProducts
|
||||||
|
@pclose = "pclose"
|
||||||
|
@showProTable = "showProTable"
|
||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
<commonShopTable
|
||||||
|
ref="commonShopTable"
|
||||||
|
:currentId="courseId"
|
||||||
|
currentType="courseLinkPro"
|
||||||
|
@linkList="linkList"
|
||||||
|
></commonShopTable>
|
||||||
|
<el-dialog
|
||||||
|
title="课程引用一览"
|
||||||
|
:visible.sync="resListVisible"
|
||||||
|
width="60%"
|
||||||
|
@close="closeLink"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div v-if="resList.length > 0">
|
||||||
|
<div style="margin-bottom:20px">当前课程共有 {{resList.length}} 个标签引用</div>
|
||||||
|
<div v-for="(item, index) in resList" :key="index">
|
||||||
|
{{index + 1}}、 {{ item.title }}
|
||||||
|
<span v-if="item.isLast != 1">
|
||||||
|
<span v-for="(item1, index1) in item.children" :key="index1"
|
||||||
|
> > {{ item1.title }}
|
||||||
|
<span v-if="item1.isLast != 1">
|
||||||
|
<span
|
||||||
|
v-for="(item2, index2) in item1.children"
|
||||||
|
:key="index2"
|
||||||
|
> > {{ item2.title }}
|
||||||
|
<span v-if="item2.isLast != 1">
|
||||||
|
<span
|
||||||
|
v-for="(item3, index3) in item2.children"
|
||||||
|
:key="index3"
|
||||||
|
> > {{ item3.title }}</span
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>这门课程还没有被标签引用哦~</div>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="closeLink">好 的</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import commonShopTable from "./shopproductTable.vue";
|
||||||
import AddOrUpdate from "./course-add-or-update";
|
import AddOrUpdate from "./course-add-or-update";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -359,9 +415,11 @@ export default {
|
|||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
courseId:"0",
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ""
|
key: "",
|
||||||
},
|
},
|
||||||
|
relationProducts:[],
|
||||||
query: {
|
query: {
|
||||||
type: "",
|
type: "",
|
||||||
categoryId: "",
|
categoryId: "",
|
||||||
@@ -379,11 +437,14 @@ export default {
|
|||||||
urlList: {
|
urlList: {
|
||||||
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
||||||
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
||||||
}
|
},
|
||||||
|
resList: [],
|
||||||
|
resListVisible: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate,
|
||||||
|
commonShopTable
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
if (this.$route.query.upPageInde != null) {
|
if (this.$route.query.upPageInde != null) {
|
||||||
@@ -395,6 +456,53 @@ export default {
|
|||||||
this.getTreeList(this.urlList.sociologyList, 2);
|
this.getTreeList(this.urlList.sociologyList, 2);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delPro(val){
|
||||||
|
console.log(val,this.relationProducts)
|
||||||
|
let list = this.relationProducts
|
||||||
|
|
||||||
|
|
||||||
|
this.relationProducts = list.slice(1,1)
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
pclose(){
|
||||||
|
this.relationProducts = []
|
||||||
|
this.courseId = null
|
||||||
|
console.log('关闭了 ')
|
||||||
|
},
|
||||||
|
linkList(data){
|
||||||
|
console.log('父级',data)
|
||||||
|
if(data && data.length > 0){
|
||||||
|
this.relationProducts = data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showProTable(data){
|
||||||
|
console.log('data',data)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.commonShopTable.open();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
closeLink() {
|
||||||
|
this.resListVisible = false;
|
||||||
|
this.resList = [];
|
||||||
|
},
|
||||||
|
showLinkTags(row) {
|
||||||
|
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/course/getCourseLableLinkList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
courseId: row.id
|
||||||
|
})
|
||||||
|
}).then(res => {
|
||||||
|
this.resListVisible = true;
|
||||||
|
if (res.data.code == 0 && res.data.resList.length > 0) {
|
||||||
|
this.resList = res.data.resList;
|
||||||
|
|
||||||
|
}
|
||||||
|
// console.log(row, "row" , res.data.resList,this.resList);
|
||||||
|
});
|
||||||
|
},
|
||||||
handleChange(value) {
|
handleChange(value) {
|
||||||
console.log(value, "989999999");
|
console.log(value, "989999999");
|
||||||
},
|
},
|
||||||
@@ -424,6 +532,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
|
this.relationProducts = []
|
||||||
var data = {
|
var data = {
|
||||||
page: this.pageIndex,
|
page: this.pageIndex,
|
||||||
limit: this.pageSize,
|
limit: this.pageSize,
|
||||||
@@ -486,6 +595,8 @@ export default {
|
|||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
addOrUpdateHandle(row) {
|
addOrUpdateHandle(row) {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
|
row ? this.courseId = row.id : ''
|
||||||
|
// this.courseId = row.id
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.init(row);
|
this.$refs.addOrUpdate.init(row);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,23 @@
|
|||||||
<img v-if="scope.row.imgUrl != ''" :src="scope.row.imgUrl" width="70" height="100" class="tableImg" />
|
<img v-if="scope.row.imgUrl != ''" :src="scope.row.imgUrl" width="70" height="100" class="tableImg" />
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
width="130"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="排序( 双击修改 )"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="paixu" @dblclick="myDbClick(scope.row)">
|
||||||
|
<span v-show="!scope.row.isEdit">{{scope.row.sort}}</span>
|
||||||
|
<div class="inputBox" v-show="scope.row.isEdit">
|
||||||
|
<el-input @keyup.enter.native="changeSort(scope.row)" min="0" @blur="changeSort(scope.row)" v-model.number="scope.row.sort" ></el-input>
|
||||||
|
<el-tag type="danger" size="mini" @click="cancelBtn(scope.row)">×</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="content" header-align="center" align="center" label="内容">
|
<!-- <el-table-column prop="content" header-align="center" align="center" label="内容">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
@@ -71,7 +88,8 @@ export default {
|
|||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false
|
addOrUpdateVisible: false,
|
||||||
|
oldSort:0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -90,6 +108,43 @@ export default {
|
|||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelBtn(row){
|
||||||
|
row.isEdit = false
|
||||||
|
this.oldSort = 0
|
||||||
|
if(row.sort == ""){row.sort = 0}
|
||||||
|
},
|
||||||
|
changeSort(row){ // 确认排序
|
||||||
|
if(this.oldSort == row.sort) {return}
|
||||||
|
if(row.sort == ""){row.sort = 0}
|
||||||
|
row.isEdit = false
|
||||||
|
// console.log(row)
|
||||||
|
// return false
|
||||||
|
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('/master/course/editCourseCatalogueChapterVideo'),
|
||||||
|
method: 'post',
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"id": row.id,
|
||||||
|
'chapterId': row.chapterId,
|
||||||
|
'type': row.type,
|
||||||
|
"video": row.video,
|
||||||
|
// "content": this.dataForm.content,
|
||||||
|
"sort": row.sort,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if(data.code == 0 && data.msg == "success"){
|
||||||
|
this.getDataList()
|
||||||
|
this.oldSort = 0
|
||||||
|
// console.log(this.oldSort,'复原')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
myDbClick(row){ // 双击修改排序
|
||||||
|
this.oldSort = row.sort
|
||||||
|
console.log(this.oldSort,88888888)
|
||||||
|
row.isEdit = true
|
||||||
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
@@ -107,6 +162,10 @@ export default {
|
|||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0 && data.page && data.page.records) {
|
if (data && data.code === 0 && data.page && data.page.records) {
|
||||||
|
var list = data.page.records
|
||||||
|
list.forEach(item => {
|
||||||
|
item.isEdit = false
|
||||||
|
});
|
||||||
this.dataList = data.page.records
|
this.dataList = data.page.records
|
||||||
this.totalPage = data.page.total
|
this.totalPage = data.page.total
|
||||||
} else {
|
} else {
|
||||||
@@ -255,3 +314,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.paixu{cursor: pointer;}
|
||||||
|
.inputBox{display: flex; align-items:center;
|
||||||
|
.el-input{margin-right: 5px;}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -116,6 +116,7 @@
|
|||||||
:action="baseUrl + '/oss/fileoss'"
|
:action="baseUrl + '/oss/fileoss'"
|
||||||
:on-remove="audioHandleRemove"
|
:on-remove="audioHandleRemove"
|
||||||
:on-success="audioUploadSuccess"
|
:on-success="audioUploadSuccess"
|
||||||
|
:before-upload="onprogress"
|
||||||
accept=".mp3"
|
accept=".mp3"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:file-list="audioFileList"
|
:file-list="audioFileList"
|
||||||
@@ -611,6 +612,9 @@ export default {
|
|||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onprogress(){
|
||||||
|
this.$message('上传中,请勿关闭或进行其他操作');
|
||||||
|
},
|
||||||
audioHandleRemove(file, fileList) {
|
audioHandleRemove(file, fileList) {
|
||||||
console.log(file, fileList);
|
console.log(file, fileList);
|
||||||
this.audioFileList = []
|
this.audioFileList = []
|
||||||
@@ -619,6 +623,7 @@ export default {
|
|||||||
audioUploadSuccess(res, file) {
|
audioUploadSuccess(res, file) {
|
||||||
this.audioFileList = []
|
this.audioFileList = []
|
||||||
this.audioFileList.push(file)
|
this.audioFileList.push(file)
|
||||||
|
this.$message.success('上传成功');
|
||||||
console.log(this.audioFileList,res, "上传成功");
|
console.log(this.audioFileList,res, "上传成功");
|
||||||
this.addForm.media = res.url
|
this.addForm.media = res.url
|
||||||
|
|
||||||
|
|||||||
288
src/views/modules/course/moveCourse.vue
Normal file
288
src/views/modules/course/moveCourse.vue
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
ref="drawer"
|
||||||
|
title="课程迁移"
|
||||||
|
:visible.sync="drawerVisible"
|
||||||
|
direction="rtl"
|
||||||
|
:before-close="drawerHandleClose"
|
||||||
|
>
|
||||||
|
<!-- ------------------------- -->
|
||||||
|
<div style="padding:15px">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
<div style="display:flex;align-items:end">
|
||||||
|
<el-form-item label="课程名称">
|
||||||
|
<el-input
|
||||||
|
v-model="query.courseName"
|
||||||
|
placeholder="课程名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="平台分类">
|
||||||
|
<el-cascader
|
||||||
|
clearable
|
||||||
|
:props="{
|
||||||
|
label: 'title',
|
||||||
|
value: 'id',
|
||||||
|
checkStrictly: true
|
||||||
|
}"
|
||||||
|
v-model="selectType"
|
||||||
|
:options="options"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label=" ">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
<!-- <el-button type="primary" @click="addOrUpdateHandle()"
|
||||||
|
>新增</el-button
|
||||||
|
> -->
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程名"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span>{{ scope.row.title }}</span>
|
||||||
|
<!-- <el-tooltip placement="bottom" effect="light">
|
||||||
|
<div slot="content">多行信息<br />第二行信息多行信息<br />第二行信息多行信息<br />第二行信息多行信息第二行信息多行信息第二行信息</div>
|
||||||
|
<i
|
||||||
|
class="el-icon-paperclip"
|
||||||
|
style=" color:#17B3A3; margin-left:15px"
|
||||||
|
></i>
|
||||||
|
</el-tooltip> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="totalPage"
|
||||||
|
style="padding: 30px 0; text-align: center;"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
<div style="text-align:center">
|
||||||
|
<el-button type="primary" @click="moveCourseBtn">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ----------------------------- -->
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: ["catalogueId","catalogueTitle"],
|
||||||
|
data() {
|
||||||
|
|
||||||
|
return {
|
||||||
|
drawerVisible: true,
|
||||||
|
selectType: [],
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
id: "all",
|
||||||
|
title: "全部",
|
||||||
|
children: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: "医学",
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: "国学",
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
multipleSelection: [],
|
||||||
|
query: {
|
||||||
|
type: "",
|
||||||
|
categoryId: "",
|
||||||
|
sociologyId: "",
|
||||||
|
courseName: ""
|
||||||
|
},
|
||||||
|
dataList: [],
|
||||||
|
delFlag: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlList: {
|
||||||
|
medicalList: "/master/courseMedical/getCourseMedicalList", //医学
|
||||||
|
sociologyList: "/master/courseSociology/getCourseSociologyList" //国学
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {},
|
||||||
|
drawerHandleClose() {
|
||||||
|
this.$emit("mycloseDrawer", "drawer");
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$message.error("只可以选择一门课程进行迁移哦~");
|
||||||
|
} else {
|
||||||
|
this.multipleSelection = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(22, this.multipleSelection);
|
||||||
|
},
|
||||||
|
moveCourseBtn() {
|
||||||
|
if (this.multipleSelection.length == 0) {
|
||||||
|
this.$message.error("请选择您要迁移的目标课程!");
|
||||||
|
} else if (this.multipleSelection.length > 1) {
|
||||||
|
this.$message.error("只可以选择一门课程进行迁移哦~");
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
`${this.catalogueTitle}目录 即将迁移到 ${this.multipleSelection[0].title}课程内, 是否继续?`,
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
|
||||||
|
if(!this.catalogueId){
|
||||||
|
this.$message.error('请重新选择您要转移的课程目录')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// console.log(this.catalogueId, this.multipleSelection[0].id)
|
||||||
|
// 走接口 并关闭
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(
|
||||||
|
`/master/course/courseCatalogueTransfer`
|
||||||
|
),
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
courseId: this.multipleSelection[0].id, //新课程id
|
||||||
|
catalogueId: this.catalogueId //目录id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
console.log("********:", res);
|
||||||
|
this.$message.success('操作成功')
|
||||||
|
this.drawerHandleClose()
|
||||||
|
}).catch(()=>{
|
||||||
|
this.$message.error('操作失败')
|
||||||
|
});
|
||||||
|
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs["moveCourse"].getDataList();
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// checkSelectable(row){
|
||||||
|
// return row.auditStatus === '0'
|
||||||
|
// console.log(row,'row')
|
||||||
|
// },
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
var data = {
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
courseName: this.query.courseName //关键字
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.selectType.length == 0) {
|
||||||
|
data.type = 0;
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = "";
|
||||||
|
} else if (this.selectType.length >= 1) {
|
||||||
|
data.type = this.selectType[0] == "all" ? 0 : this.selectType[0];
|
||||||
|
if (this.selectType.length == 1) {
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = "";
|
||||||
|
}
|
||||||
|
if (this.selectType.length > 1) {
|
||||||
|
if (this.selectType[0] == 1) {
|
||||||
|
data.medicalId = this.selectType[this.selectType.length - 1];
|
||||||
|
data.sociologyId = "";
|
||||||
|
}
|
||||||
|
if (this.selectType[0] == 2) {
|
||||||
|
data.medicalId = "";
|
||||||
|
data.sociologyId = this.selectType[this.selectType.length - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/course/getCourseList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.page.records;
|
||||||
|
this.totalPage = data.page.total;
|
||||||
|
} else {
|
||||||
|
this.dataList = [];
|
||||||
|
this.totalPage = 0;
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.dataListSelections = val;
|
||||||
|
}
|
||||||
|
// 新增 / 修改
|
||||||
|
// addOrUpdateHandle(row) {
|
||||||
|
// this.addOrUpdateVisible = true;
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.addOrUpdate.init(row);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
361
src/views/modules/course/shopproductTable.vue
Normal file
361
src/views/modules/course/shopproductTable.vue
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-drawer title="新增关联商品" v-if="drawer" :wrapperClosable="false" :visible.sync="drawer" :before-close="handleClose" destroy-on-close
|
||||||
|
direction="rtl" size="70%">
|
||||||
|
<div class="shop_drawer_box demo-drawer__content">
|
||||||
|
<div class="addFormBox">
|
||||||
|
<el-form ref="addForm" label-width="80px" :model="dataForm">
|
||||||
|
<el-form-item label="商品名称" prop="keywords" class="form_item">
|
||||||
|
<el-input size="small" placeholder="请输入商品名称" style="width: 100%" v-model="dataForm.keywords" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品类型" prop="type" class="form_item">
|
||||||
|
<el-select size="small" v-model="dataForm.type" placeholder="请选择" style="width: 100%" clearable>
|
||||||
|
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue"
|
||||||
|
:value="item.dictType">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="" class="form_item" label-width="20px" style="width: 160px !important">
|
||||||
|
<el-button type="primary" plain @click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList(bookMarketId);
|
||||||
|
" size="small">查询</el-button>
|
||||||
|
<el-button @click="handleReset()" size="small" plain>重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table ref="table" height="80%" :data="dataList" :row-key="getRowKeys" border size="mini"
|
||||||
|
v-loading="dataListLoading" @selection-change="handleSelectionChange" style="width: 100%">
|
||||||
|
<!-- <el-table-column :reserve-selection="true" type="selection" header-align="center" align="center" width="50">
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- -->
|
||||||
|
<el-table-column label="商品ID" width="70" align="center" prop="productId">
|
||||||
|
<!-- <template slot-scope="scope">
|
||||||
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
|
</template> -->
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productName" header-align="center" align="center" label="商品名称">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" width="120" header-align="center" align="center" sortable label="价格">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="activityPrice" width="120" header-align="center" align="center" sortable label="活动价">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productStock" width="120" header-align="center" align="center" sortable label="库存">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column header-align="center" align="center" label="商品图" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="25" height="35"
|
||||||
|
class="tableImg" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productStock" width="120" header-align="center" align="center" sortable label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" plain size="mini" @click="addLink(scope.row, scope.$index)">添加</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper">
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
<!-- <div class="demo-drawer__footer">
|
||||||
|
<div style="float: right; margin-top: 20px">
|
||||||
|
<el-button @click="close" size="small">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit" :loading="loading" size="small">{{ loading ? "提交中 ..." : "确 定"
|
||||||
|
}}</el-button>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
|
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @showchooseBookf = "showchooseBookf"></add-or-update>
|
||||||
|
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book> -->
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import chooseBook from './chooseBook.vue'
|
||||||
|
// import AddOrUpdate from './shopproduct-add-or-update'
|
||||||
|
export default {
|
||||||
|
props: ["currentType", "currentId"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timer: null,
|
||||||
|
drawer: false,
|
||||||
|
loading: false,
|
||||||
|
multipleSelectionAll: [], // 所有选中的数据包含跨页数据
|
||||||
|
multipleSelection: [], // 当前页选中的数据
|
||||||
|
idKey: "productId", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
|
||||||
|
dataForm: {
|
||||||
|
type:'00'
|
||||||
|
},
|
||||||
|
bookMarketId: null,
|
||||||
|
dataList: [],
|
||||||
|
publishStatus: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
chooseBookVisible: false,
|
||||||
|
bookIds: [],
|
||||||
|
goodsTypeList: [],
|
||||||
|
linkList:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate,
|
||||||
|
// chooseBook
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addLink(row,i){
|
||||||
|
// 添加商品绑定
|
||||||
|
this.linkList.push(row)
|
||||||
|
console.log('linkList',this.linkList)
|
||||||
|
this.dataList.splice(i,1)
|
||||||
|
// this.getDataList()
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.dataForm = {
|
||||||
|
type:'00'
|
||||||
|
};
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
// var ids = this.multipleSelection.map((e) => e.productId).toString(",");
|
||||||
|
// this.$emit("submit", ids);
|
||||||
|
// console.log(
|
||||||
|
// "🚀 ~ submit ~ this.multipleSelection:",
|
||||||
|
// this.multipleSelection
|
||||||
|
// );
|
||||||
|
// this.drawer = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取商品类型
|
||||||
|
getGoodsTypeList() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/sysdictdata/selectByType/goodsType"),
|
||||||
|
method: "get",
|
||||||
|
}).then(({ data }) => {
|
||||||
|
// console.log(data.dataList)
|
||||||
|
this.goodsTypeList = data.dataList;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose(done) {
|
||||||
|
|
||||||
|
this.$bus.$emit("linkList", this.linkList );
|
||||||
|
this.linkList = []
|
||||||
|
// this.$emit("linkList", this.linkList)
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
async open() {
|
||||||
|
this.drawer = true;
|
||||||
|
this.dataForm = {
|
||||||
|
type:'00'
|
||||||
|
};
|
||||||
|
this.pageIndex = 1;
|
||||||
|
await this.getGoodsTypeList();
|
||||||
|
await this.getDataList();
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.drawer = false;
|
||||||
|
|
||||||
|
},
|
||||||
|
getRowKeys(row) {
|
||||||
|
return row.productId;
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
console.log("🚀 ~ handleSelectionChange ~ val:", val);
|
||||||
|
// table组件选中事件,记得加上@selection-change="handleSelectionChange"
|
||||||
|
this.multipleSelection = val;
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
},
|
||||||
|
|
||||||
|
closeBookf() {
|
||||||
|
this.chooseBookVisible = false;
|
||||||
|
},
|
||||||
|
showchooseBookf(e) {
|
||||||
|
// 显示图书列表
|
||||||
|
this.chooseBookVisible = true;
|
||||||
|
// console.log(this.bookIds,'this.bookIds')
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.chooseBook.getBookList()
|
||||||
|
// this.bookIds = e.bookIds
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
async getDataList() {
|
||||||
|
var form = {
|
||||||
|
...this.dataForm,
|
||||||
|
keywords:this.dataForm.keywords ? this.dataForm.keywords : '',
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
id: this.currentId
|
||||||
|
// productId: "",
|
||||||
|
};
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.clear();
|
||||||
|
// let _url = "/master/shopProduct/listByPage"
|
||||||
|
|
||||||
|
// await this.$http({
|
||||||
|
// url: this.$http.adornUrl(_url),
|
||||||
|
// method: "post",
|
||||||
|
// data: {
|
||||||
|
// "current": form.page,
|
||||||
|
// "limit": form.limit,
|
||||||
|
// "productName": form.keywords,
|
||||||
|
// "goodsType": form.type
|
||||||
|
// },
|
||||||
|
// header: {
|
||||||
|
// //默认 无 说明:请求头
|
||||||
|
// "Content-Type": "application/json"
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
await this.$http({
|
||||||
|
url: this.$http.adornUrl(`/master/course/getProductListForCourse`),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"page": form.page,
|
||||||
|
"limit": form.limit,
|
||||||
|
"productName": form.keywords,
|
||||||
|
"goodsType": form.type,
|
||||||
|
"courseId": form.id
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.shopProductListhopProducts.records;
|
||||||
|
this.totalPage = data.shopProductListhopProducts.total;
|
||||||
|
} else {
|
||||||
|
this.dataList = [];
|
||||||
|
this.totalPage = 0;
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
// this.$refs.table.clearSelection();
|
||||||
|
this.multipleSelection = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
// 改变页的时候调用一次
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.dataListSelections = val;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addOrUpdateHandle(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id) {
|
||||||
|
var ids = id
|
||||||
|
? [id]
|
||||||
|
: this.dataListSelections.map((item) => {
|
||||||
|
return item.productId;
|
||||||
|
});
|
||||||
|
this.$confirm(
|
||||||
|
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/shopproduct/delete"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(ids, false),
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
SwitchChange(event) {
|
||||||
|
/*点击时他会自动把你绑定的值变更,直接去请求数据就可以了*/
|
||||||
|
var parms = {
|
||||||
|
publishStatus: event.publishStatus,
|
||||||
|
productId: event.productId,
|
||||||
|
};
|
||||||
|
// console.log(parms)
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/shopproduct/update"),
|
||||||
|
method: "post",
|
||||||
|
data: parms,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: "成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.loading = false;
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
console.log(event);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.shop_drawer_box {
|
||||||
|
padding: 20px !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addFormBox {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
// overflow: hidden;
|
||||||
|
.form_item {
|
||||||
|
width: 33%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-drawer__header {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -450,6 +450,7 @@ export default {
|
|||||||
this.$message.error("请输入标签名称");
|
this.$message.error("请输入标签名称");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
this.addForm.content = ''
|
||||||
await this.$refs[formName].validate(async valid => {
|
await this.$refs[formName].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
await this.$http({
|
await this.$http({
|
||||||
|
|||||||
@@ -84,6 +84,10 @@
|
|||||||
{
|
{
|
||||||
dictType: 1,
|
dictType: 1,
|
||||||
dictValue: "加密"
|
dictValue: "加密"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "mp3"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
<el-table :data="dataList" border v-loading="dataListLoading"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
<!-- <el-table-column type="selection" header-align="center" align="center" width="50">
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column label="序号" width="70" align="center">
|
<!-- <el-table-column label="序号" width="70" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
@@ -29,14 +29,21 @@
|
|||||||
label="用户ID">
|
label="用户ID">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.name ? scope.row.name : '暂无用户名'}}</span>-
|
||||||
|
<span v-if="scope.row.vip == 0">普通用户</span>
|
||||||
|
<span v-else-if="scope.row.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="scope.row.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="scope.row.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="sex" header-align="center" align="center" label="性别">
|
<!-- <el-table-column prop="sex" header-align="center" align="center" label="性别">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
|
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column prop="avatar" header-align="center" align="center" label="头像">
|
<el-table-column prop="avatar" header-align="center" align="center" label="头像">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<img v-if="scope.row.avatar && scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" />
|
<img v-if="scope.row.avatar && scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" />
|
||||||
@@ -76,10 +83,10 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="阅读时间">
|
label="阅读时间">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="lastLoginTime" header-align="center" align="center" label="最后登录时间">
|
<!-- <el-table-column prop="lastLoginTime" header-align="center" align="center" label="最后登录时间">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间">
|
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间">
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间">
|
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
@@ -105,6 +112,13 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item><el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button></el-dropdown-item>
|
<el-dropdown-item><el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button></el-dropdown-item>
|
||||||
<el-dropdown-item><el-button type="text" size="small" @click="resetPassword(scope.row)">修改密码</el-button></el-dropdown-item>
|
<el-dropdown-item><el-button type="text" size="small" @click="resetPassword(scope.row)">修改密码</el-button></el-dropdown-item>
|
||||||
|
<el-dropdown-item>
|
||||||
|
<router-link :to="{ path: '/userCourse', query: {id:scope.row.id} }">
|
||||||
|
<el-button type="text" size="small">
|
||||||
|
用户课程管理
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
|
<!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -232,6 +246,10 @@
|
|||||||
this.getcourpeList()
|
this.getcourpeList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 用户课程
|
||||||
|
userCourse(val){
|
||||||
|
|
||||||
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
|
|||||||
453
src/views/modules/user/userCourse.vue
Normal file
453
src/views/modules/user/userCourse.vue
Normal file
@@ -0,0 +1,453 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="showAddD" type="primary">开通课程</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="dataForm.key" placeholder="请输入课程名" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item >
|
||||||
|
<el-button
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="float:right">
|
||||||
|
<div v-if="user.id" class="flexbox userInfo">
|
||||||
|
<div>用户信息:{{ user.name }}{{ user.tel }}</div>
|
||||||
|
<div>
|
||||||
|
<span v-if="user.vip == 0">(普通用户)</span>
|
||||||
|
<span v-else-if="user.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程名"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="catalogueName"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="分部"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="startTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="开通时间"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="endTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="到期时间"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="150"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope"> </template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="开通课程"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="youVisible"
|
||||||
|
append-to-body
|
||||||
|
width="60%"
|
||||||
|
@close="dialogClose"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="youForm"
|
||||||
|
label-width="100px"
|
||||||
|
ref="youForm"
|
||||||
|
:rules="youFormRule"
|
||||||
|
>
|
||||||
|
<el-form-item label="用户">
|
||||||
|
{{ user.tel }} <span v-if="user.name != ''">{{ user.name }}</span>
|
||||||
|
<span v-if="user.vip == 0">普通用户</span>
|
||||||
|
<span v-else-if="user.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="flexbox">
|
||||||
|
<div>
|
||||||
|
<el-form-item label="课程名:" prop="courseId">
|
||||||
|
<el-select
|
||||||
|
v-model="youForm.courseId"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入课程名并选择您要添加的课程"
|
||||||
|
:remote-method="remoteMethod"
|
||||||
|
:loading="totalLaoding"
|
||||||
|
@change="selectChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.title"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-input v-model="youForm.key" placeholder="" clearable></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<div v-if="youForm.cate.length > 0" style="margin-left:20px">
|
||||||
|
<el-form-item
|
||||||
|
label="请选择开通的分部:"
|
||||||
|
label-width="150px"
|
||||||
|
prop="catalogueId"
|
||||||
|
>
|
||||||
|
<div v-for="(item, index) in youForm.cate"
|
||||||
|
:key="index">
|
||||||
|
<el-radio
|
||||||
|
v-model="youForm.catalogueId"
|
||||||
|
:label="item.id"
|
||||||
|
>{{ item.title }}</el-radio
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-form-item label="开通时长:" v-if="youForm.courseId" prop="days">
|
||||||
|
<el-select v-model="youForm.days" placeholder="请选择开通时长">
|
||||||
|
<el-option
|
||||||
|
v-for="item in timeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogClose">取消</el-button>
|
||||||
|
<el-button @click="submit" type="primary">确认开通</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import AddOrUpdate from './user-add-or-update'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
userId: this.$route.query.id,
|
||||||
|
user: {},
|
||||||
|
pointFormRules: {
|
||||||
|
pointAmount: [
|
||||||
|
{ required: true, message: "请输入金额", trigger: "blur" }
|
||||||
|
],
|
||||||
|
pointType: {
|
||||||
|
required: true,
|
||||||
|
message: "请选择操作类型",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
youFormRule: {
|
||||||
|
catalogueId: [
|
||||||
|
{ required: true, message: "请选择开通的分部", trigger: "blur" }
|
||||||
|
],
|
||||||
|
days: [{ required: true, message: "请选择开通时长", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
options: [],
|
||||||
|
timeOptions: [
|
||||||
|
// 开通时长
|
||||||
|
{
|
||||||
|
value: "30",
|
||||||
|
label: "一个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "60",
|
||||||
|
label: "两个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "90",
|
||||||
|
label: "三个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "120",
|
||||||
|
label: "四个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "150",
|
||||||
|
label: "五个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "180",
|
||||||
|
label: "六个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "365",
|
||||||
|
label: "一年"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "730",
|
||||||
|
label: "两年"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataList: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
total: 0,
|
||||||
|
totalLaoding: false,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
|
||||||
|
youVisible: false,
|
||||||
|
|
||||||
|
youForm: {
|
||||||
|
courseId: null,
|
||||||
|
cate: [],
|
||||||
|
catalogueId: null,
|
||||||
|
days: ""
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
console.log(this.$route.query);
|
||||||
|
console.log(this.userId, "onsole.log(this.$route.query)");
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
// this.getDataList()
|
||||||
|
// this.getcourpeList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
this.$refs['youForm'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
let data = {
|
||||||
|
userId:this.userId,
|
||||||
|
...this.youForm
|
||||||
|
}
|
||||||
|
delete data.cate
|
||||||
|
console.log('data',data)
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/addUserCourseBuy"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
this.$message.success('开课成功!')
|
||||||
|
this.getDataList()
|
||||||
|
this.dialogClose()
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("表单提交报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialogClose() {
|
||||||
|
this.youVisible = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.youForm.cate = [];
|
||||||
|
this.options = [];
|
||||||
|
this.$refs["youForm"].resetFields();
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
});
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
},
|
||||||
|
selectChange(val) {
|
||||||
|
// console.log('val',val)
|
||||||
|
console.log("options", this.options);
|
||||||
|
// const _obj = this.options.find(item => item.id == val);
|
||||||
|
// this.youForm.cate = _obj.courseCatalogueEntityList;
|
||||||
|
// console.log(this.youForm.cate, "this.youForm.cate");
|
||||||
|
this.getCate(val)
|
||||||
|
},
|
||||||
|
remoteMethod(query) {
|
||||||
|
console.log(query, "query", this.youForm.key);
|
||||||
|
// return false
|
||||||
|
if (this.youForm.key !== "") {
|
||||||
|
let data = {
|
||||||
|
// page: this.pageIndex,
|
||||||
|
// limit: this.pageSize,
|
||||||
|
title: query, //关键字
|
||||||
|
// medicalId: "",
|
||||||
|
// sociologyId: "",
|
||||||
|
// type: 0
|
||||||
|
};
|
||||||
|
this.totalLaoding = true;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.options = data.list;
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
}
|
||||||
|
this.totalLaoding = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAddD() {
|
||||||
|
this.youVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
if (!this.userId) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.init();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(`/book/user/info/${this.userId}`),
|
||||||
|
method: "get",
|
||||||
|
params: this.$http.adornParams()
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.user = data.user;
|
||||||
|
this.getDataList();
|
||||||
|
// if (data.user.avatar && data.user.avatar != "") {
|
||||||
|
// var img = {
|
||||||
|
// name: '',
|
||||||
|
// url: data.user.avatar
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/master/userManage/getUserCourseList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
userId: this.userId,
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
title: this.dataForm.key
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
console.log(data,'data')
|
||||||
|
this.dataList = data.result.records;
|
||||||
|
this.totalPage = data.result.pages;
|
||||||
|
this.total = data.result.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// // 多选
|
||||||
|
// selectionChangeHandle(val) {
|
||||||
|
// this.dataListSelections = val
|
||||||
|
// },
|
||||||
|
// 新增 / 修改
|
||||||
|
closeDia() {
|
||||||
|
this.adc = false;
|
||||||
|
this.$refs.pointForm.resetFields();
|
||||||
|
// this.pointForm.pointType == 0
|
||||||
|
},
|
||||||
|
getCate(id) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/catalogueListByCourse"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"courseId": id
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
console.log('data','data++++++++++++++++++++')
|
||||||
|
this.youForm.cate = data.list
|
||||||
|
// this.youForm.cate
|
||||||
|
}else{
|
||||||
|
this.youForm.cate = []
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log('数据报错')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.userInfo {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.userInfo * {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
315
src/views/modules/workOrderLIst.vue
Normal file
315
src/views/modules/workOrderLIst.vue
Normal file
@@ -0,0 +1,315 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :inline="true" :model="query" @keyup.enter.native="getDataList()">
|
||||||
|
<el-form-item label="账户名">
|
||||||
|
<el-input
|
||||||
|
v-model="query.account"
|
||||||
|
placeholder="请输入账户名"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工单类型">
|
||||||
|
<!-- <el-input
|
||||||
|
v-model="query.type"
|
||||||
|
placeholder="出版社名称"
|
||||||
|
clearable
|
||||||
|
></el-input> -->
|
||||||
|
<el-select v-model="query.type" placeholder="请选择" clearable @change="selectChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in typeLIst"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.text"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工单状态" >
|
||||||
|
<!-- <el-input
|
||||||
|
v-model="query.status"
|
||||||
|
placeholder="作者姓名"
|
||||||
|
clearable
|
||||||
|
></el-input> -->
|
||||||
|
<el-select v-model="query.status" placeholder="请选择" clearable @change="selectChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.text"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="getDataList()">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="type" width="150"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="工单类型"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.type | getType }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="account" width="150"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="用户账户"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="content"
|
||||||
|
header-align="center"
|
||||||
|
align="left"
|
||||||
|
label="问题描述"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>问题描述:{{scope.row.content}}</div>
|
||||||
|
<div>提交时间:{{scope.row.createTime}}</div>
|
||||||
|
<div v-if="scope.row.type == '3'">关联订单号:{{scope.row.relation}}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="150"
|
||||||
|
prop="contactInformation"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="联系电话"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="问题截图"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.images && scope.row.images.length > 0">
|
||||||
|
<img @click="clickImg(item)" :src="item" v-for="(item, index) in scope.row.images" :key="index" style="width:60px; cursor: pointer;"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="160" v-if="query.status == 1"
|
||||||
|
prop="updateTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="处理时间"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column header-align="center" align="center" label="操作" width="150px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-show="query.status == 0"
|
||||||
|
type="primary" plain
|
||||||
|
size="small"
|
||||||
|
@click="changeHandle(scope.row)"
|
||||||
|
>标记为已处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="danger" style="margin-top:15px"
|
||||||
|
size="small" plain
|
||||||
|
@click="deleteHandle(scope.row)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<img-prev-vue v-if="showImg" :url="curImg" @close="closeImg"></img-prev-vue>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import imgPrevVue from '../../components/imgPrev.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
account: "",
|
||||||
|
type: "",
|
||||||
|
status: "0"
|
||||||
|
},
|
||||||
|
showImg:false,
|
||||||
|
curImg:'',
|
||||||
|
dataList: [],
|
||||||
|
dataListLoading: false,
|
||||||
|
statusList: [
|
||||||
|
// { value: 0, text: "请选择" },
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
text: "未处理"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
text: "已处理"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// pageIndex
|
||||||
|
typeLIst: [
|
||||||
|
// { value: 0, text: "请选择" },
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
text: "登陆相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
text: "账号相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
text: "订单相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 4,
|
||||||
|
text: "购买相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
text: "VIP相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 6,
|
||||||
|
text: "充值相关问题"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 7,
|
||||||
|
text: "网络暴力举报"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 8,
|
||||||
|
text: "其他"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
getType: function(value) {
|
||||||
|
var _str = "";
|
||||||
|
switch (value) {
|
||||||
|
case "1":
|
||||||
|
_str = "登陆相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "2":
|
||||||
|
_str = "账号相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "3":
|
||||||
|
_str = "订单相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "4":
|
||||||
|
_str = "购买相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "5":
|
||||||
|
_str = "VIP相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "6":
|
||||||
|
_str = "充值相关问题";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "7":
|
||||||
|
_str = "网络暴力举报";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "8":
|
||||||
|
_str = "其他";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _str;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components:{
|
||||||
|
imgPrevVue
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
selectChange(){
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
closeImg(){
|
||||||
|
this.showImg = false
|
||||||
|
this.curImg = ''
|
||||||
|
},
|
||||||
|
clickImg(url){
|
||||||
|
console.log('url',url)
|
||||||
|
this.curImg = url
|
||||||
|
this.showImg = true
|
||||||
|
},
|
||||||
|
changeHandle(val){
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/common/sysFeedback/editStatusById"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({ sysFeedbackId: val.id })
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
this.$message.success('设置成功')
|
||||||
|
this.getDataList()
|
||||||
|
}).catch(e => {
|
||||||
|
this.$message.error("设置失败");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteHandle(val){
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/common/sysFeedback/delById"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({ sysFeedbackId: val.id })
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getDataList()
|
||||||
|
}).catch(e => {
|
||||||
|
this.$message.error("删除失败");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/common/sysFeedback/getList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({ ...this.query })
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data.code == 0) {
|
||||||
|
let _list = []
|
||||||
|
if(data.res.length > 0){
|
||||||
|
_list = data.res
|
||||||
|
_list.forEach(item => {
|
||||||
|
if(item.image && item.image != ''){
|
||||||
|
item.images = item.image.split(",");
|
||||||
|
// console.log('item.image',item.images)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('_list',_list)
|
||||||
|
this.dataList = _list;
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.dataList = [];
|
||||||
|
this.dataListLoading = false;
|
||||||
|
this.$message.error("获取数据失败");
|
||||||
|
// console.log("表单提交报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {};
|
||||||
|
|
||||||
// api接口请求地址
|
// api接口请求地址
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
|
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||||
window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
// window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';//磊哥
|
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';//磊哥
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||||
|
|||||||
Reference in New Issue
Block a user