Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-master-html
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<slot name="tableItem"></slot>
|
||||
|
||||
<!-- <el-table-column
|
||||
:reserve-selection="true"
|
||||
type="selection"
|
||||
@@ -82,9 +83,11 @@
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作"
|
||||
width="80"
|
||||
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<slot name="operation" :row="scope.row"></slot>
|
||||
<el-button
|
||||
type="text"
|
||||
style="color: red;"
|
||||
@@ -322,12 +325,36 @@ export default {
|
||||
|
||||
this.dataListLoading = true;
|
||||
|
||||
if (this.otherInfo.httpType == "raw") {
|
||||
if (this.otherInfo.httpType == "raw"&&this.otherInfo.isNoPaging ) {
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||
method: "POST",
|
||||
data: { current: 1,
|
||||
limit: 99999999,
|
||||
...form
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.associatedGoodsList = [...data.result.records];
|
||||
|
||||
this.dataListLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else if (this.otherInfo.httpType == "raw") {
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
|
||||
...form
|
||||
},
|
||||
header: {
|
||||
|
||||
@@ -248,6 +248,7 @@ export default {
|
||||
this.clear();
|
||||
if (this.otherInfo.httpType == "raw") {
|
||||
form.page = this.pageIndex;
|
||||
form.current = this.pageIndex;
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.CanBindProductList}`),
|
||||
|
||||
459
src/views/modules/commonNews/course-add-or-update.vue
Normal file
459
src/views/modules/commonNews/course-add-or-update.vue
Normal file
@@ -0,0 +1,459 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
width="1260px"
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
@close="handlereset"
|
||||
style="height: auto;"
|
||||
>
|
||||
<div style="margin-bottom: 60px;">
|
||||
<el-form
|
||||
style="height: auto;"
|
||||
class="addFormBox"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="消息标题" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="消息标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-col :span="24">
|
||||
<el-col :span="8"
|
||||
><el-form-item label="链接方式" prop="type">
|
||||
<el-select
|
||||
@change="changeType"
|
||||
v-model="dataForm.type"
|
||||
size="small"
|
||||
placeholder="请选择链接方式"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in linkList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-radio-group v-model="dataForm.type">
|
||||
<el-radio
|
||||
v-for="item in linkList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group> -->
|
||||
</el-form-item></el-col
|
||||
>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发布APP" prop="splits">
|
||||
<el-checkbox
|
||||
v-model="dataForm[item.valueName]"
|
||||
v-for="(item, i) in APPList"
|
||||
:key="i"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
>{{ item.label }}</el-checkbox
|
||||
>
|
||||
</el-form-item></el-col
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="dataForm.type == 0">
|
||||
<el-form-item label="链接地址" prop="url">
|
||||
<el-input
|
||||
v-model="dataForm.url"
|
||||
placeholder="链接地址"
|
||||
:rows="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="dataForm.type == 1">
|
||||
<div style="height: auto;margin-bottom: 80px;">
|
||||
<el-form-item label="内容" prop="url">
|
||||
<el-upload
|
||||
class="chapter-avatar-uploader"
|
||||
:action="baseUrl + '/oss/fileoss'"
|
||||
accept=".jpeg,.jpg,.gif,.png"
|
||||
:show-file-list="false"
|
||||
:on-success="contentUploadSuccess"
|
||||
>
|
||||
</el-upload>
|
||||
<quill-editor
|
||||
v-model="dataForm.content"
|
||||
ref="myQuillEditor"
|
||||
style="height: 400px;"
|
||||
:options="editorOption"
|
||||
@blur="onEditorBlur($event)"
|
||||
@focus="onEditorFocus($event)"
|
||||
@ready="onEditorReady($event)"
|
||||
class="chapter_editor"
|
||||
>
|
||||
</quill-editor>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handlereset">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||
["blockquote", "code-block"], //引用,代码块
|
||||
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ direction: "rtl" }], // 文字输入方向
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 颜色选择
|
||||
[
|
||||
{
|
||||
font: [
|
||||
"SimSun",
|
||||
"SimHei",
|
||||
"Microsoft-YaHei",
|
||||
"KaiTi",
|
||||
"FangSong",
|
||||
"Arial"
|
||||
]
|
||||
}
|
||||
], // 字体
|
||||
[{ align: [] }], // 居中
|
||||
["clean"], // 清除样式,
|
||||
["link", "image"] // 上传图片、上传视频
|
||||
];
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
visible: false,
|
||||
// 富文本编辑器配置
|
||||
editorOption: {
|
||||
modules: {
|
||||
history: {
|
||||
delay: 1000,
|
||||
maxStack: 50,
|
||||
userOnly: false
|
||||
},
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
handlers: {
|
||||
image: function(value) {
|
||||
if (value) {
|
||||
// 调用element的图片上传组件
|
||||
document
|
||||
.querySelector(".chapter-avatar-uploader input")
|
||||
.click();
|
||||
} else {
|
||||
this.quill.format("image", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
placeholder: "请输入正文"
|
||||
},
|
||||
bookList: [
|
||||
{
|
||||
dictType: 0,
|
||||
dictValue: "普通"
|
||||
},
|
||||
{
|
||||
dictType: 1,
|
||||
dictValue: "中医经典"
|
||||
},
|
||||
{
|
||||
dictType: 2,
|
||||
dictValue: "国学经典"
|
||||
}
|
||||
],
|
||||
medicaldesBookTypeList: [
|
||||
{
|
||||
dictType: 1,
|
||||
dictValue: "中医基础"
|
||||
},
|
||||
{
|
||||
dictType: 2,
|
||||
dictValue: "中医经典"
|
||||
},
|
||||
{
|
||||
dictType: 3,
|
||||
dictValue: "各家学说"
|
||||
},
|
||||
{
|
||||
dictType: 4,
|
||||
dictValue: "中医临床"
|
||||
},
|
||||
{
|
||||
dictType: 5,
|
||||
dictValue: "文学"
|
||||
},
|
||||
{
|
||||
dictType: 6,
|
||||
dictValue: "哲学"
|
||||
}
|
||||
],
|
||||
props: {
|
||||
dictType: "",
|
||||
dictValue: ""
|
||||
},
|
||||
gushuList: [],
|
||||
linkList: [{ label: "外链", value: 0 }, { label: "富文本", value: 1 }],
|
||||
restaurants: [],
|
||||
author: "",
|
||||
publisherList: [],
|
||||
fileList: [],
|
||||
fileListNovel: [],
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
dataForm: {
|
||||
type: 0,
|
||||
title: "",
|
||||
isBook: 0, //是否是疯子读书
|
||||
isMedical: 0, //是否是吴门医述
|
||||
isSociology: 0 //是否是众妙之门
|
||||
},
|
||||
APPList: [
|
||||
{ label: "疯子读书", value: 2, valueName: "isBook" },
|
||||
{ label: "吴门医述", value: 3, valueName: "isMedical" },
|
||||
{ label: "众妙之门", value: 1, valueName: "isSociology" }
|
||||
],
|
||||
dataRule: {
|
||||
title: [
|
||||
{ required: true, message: "消息标题不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
urlList: {
|
||||
info: "/master/message/getMessageById",
|
||||
add: "/master/message/saveOrUpdateMessage"
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
// this.restaurants = this.loadAll();
|
||||
},
|
||||
methods: {
|
||||
changeType(e){
|
||||
console.log('e at line 256:', e)
|
||||
if(e==0){
|
||||
this.dataForm.content=''
|
||||
}else{
|
||||
this.dataForm.url=''
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
contentUploadSuccess(res, file) {
|
||||
// console.log(res)
|
||||
let quill = this.$refs.myQuillEditor.quill;
|
||||
// 如果上传成功
|
||||
if (res) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片,res为服务器返回的图片链接地址
|
||||
quill.insertEmbed(length, "image", res.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
// 提示信息,需引入Message
|
||||
this.$message.error("图片插入失败!");
|
||||
}
|
||||
},
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
// console.log('editor blur!', quill)
|
||||
},
|
||||
// 获得焦点事件
|
||||
onEditorFocus(quill) {
|
||||
//console.log('editor focus!', quill)
|
||||
},
|
||||
// 准备富文本编辑器
|
||||
onEditorReady(quill) {
|
||||
// console.log('editor ready!', quill)
|
||||
},
|
||||
init(row) {
|
||||
console.log("11111", row);
|
||||
if (row && row.id) {
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.info}?id=${row.id}`),
|
||||
method: "POST",
|
||||
data: {},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
|
||||
.then(res => {
|
||||
console.log("result at line 452:", res);
|
||||
if (res && res.data.code === 0) {
|
||||
var data = res.data.result;
|
||||
console.log("data at line 357:", data);
|
||||
|
||||
this.dataForm = { ...data };
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.dataForm = {
|
||||
type: 0,
|
||||
title: "",
|
||||
isBook: 0, //是否是疯子读书
|
||||
isMedical: 0, //是否是吴门医述
|
||||
isSociology: 0 //是否是众妙之门
|
||||
};
|
||||
}
|
||||
|
||||
// this.dataForm.id = row.id || 0
|
||||
// this.dataForm.title = row.title || ''
|
||||
this.visible = true;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (
|
||||
this.dataForm.isBook == 0 &&
|
||||
this.dataForm.isMedical == 0 &&
|
||||
this.dataForm.isSociology == 0
|
||||
) {
|
||||
this.$message.error("请选择发布APP");
|
||||
return;
|
||||
}console.log('this.dataForm.type at line 332:', this.dataForm)
|
||||
if (this.dataForm.type == 0 && (this.dataForm.url == ""||!this.dataForm.url)) {
|
||||
|
||||
this.$message.error("请输入链接地址");
|
||||
return;
|
||||
}
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(this.urlList.add),
|
||||
method: "POST",
|
||||
data: this.dataForm,
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
// console.log(res,'res')
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.image = res.url;
|
||||
this.fileList.push({
|
||||
name: file.name,
|
||||
url: res.url
|
||||
});
|
||||
// console.log(this.dataForm.image,'image')
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.dataForm.image = "";
|
||||
this.fileList = [];
|
||||
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dataForm.image = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleDownload(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handlereset() {
|
||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(
|
||||
`当前限制选择 3 个文件,本次选择了 ${
|
||||
files.length
|
||||
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
||||
);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`);
|
||||
},
|
||||
handleRemoveNovel(file) {
|
||||
this.dataForm.novel = "";
|
||||
},
|
||||
handleNovelSuccess(file) {
|
||||
this.dataForm.novel = file.url;
|
||||
}
|
||||
// querySearch(queryString, cb) {
|
||||
// var restaurants = this.restaurants;
|
||||
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
||||
// // 调用 callback 返回建议列表的数据
|
||||
// console.log(results)
|
||||
// cb(results);
|
||||
// },
|
||||
// createFilter(queryString) {
|
||||
// return (restaurant) => {
|
||||
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
// };
|
||||
// },
|
||||
// handleSelect(item) {
|
||||
// this.dataForm.authorId = item.id
|
||||
// console.log(item);
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .isUpload {
|
||||
.el-uploadfeng {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/ .addFormBox.el-form-item {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
/deep/ .ql-container {
|
||||
min-height: 400px !important ;
|
||||
}
|
||||
</style>
|
||||
378
src/views/modules/commonNews/newsList.vue
Normal file
378
src/views/modules/commonNews/newsList.vue
Normal file
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<div class="mod-config" style="height: calc(100vh - 180px );">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item label="消息标题">
|
||||
<el-input
|
||||
v-model="query.title"
|
||||
placeholder="消息标题"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接方式">
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, i) in linkList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-checkbox v-model="query[item.valueName]" v-for="(item,i) in APPList" :key="i" :true-label="1" :false-label="0">{{ item.label }}</el-checkbox> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="发布APP">
|
||||
<el-select
|
||||
v-model="selectQueryApp"
|
||||
multiple
|
||||
size="small"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, i) in APPList"
|
||||
:key="item.valueName"
|
||||
:label="item.label"
|
||||
:value="item.valueName"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- <el-checkbox v-model="query[item.valueName]" v-for="(item,i) in APPList" :key="i" :true-label="1" :false-label="0">{{ item.label }}</el-checkbox> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="height: calc(100% - 80px );">
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
height="90%"
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
:show-overflow-tooltip="true"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="消息标题"
|
||||
>
|
||||
</el-table-column
|
||||
><el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="发布APP"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<span v-if="scope.row.isBook == 1">疯子读书</span>
|
||||
<span v-if="scope.row.isMedical == 1">吴门医述</span>
|
||||
<span v-if="scope.row.isSociology == 1">众妙之门</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
width="120"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="链接方式"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<span v-if="scope.row.type == 0">外链</span>
|
||||
<span v-if="scope.row.type == 1">富文本</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
width="200"
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建日期"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="180"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
</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: 10px 0; text-align: center;"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./course-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
linkList: [{ label: "外链", value: 0 }, { label: "富文本", value: 1 }],
|
||||
selectQueryApp: null,
|
||||
APPList: [
|
||||
{ label: "疯子读书", value: 2, valueName: "isBook" },
|
||||
{ label: "吴门医述", value: 3, valueName: "isMedical" },
|
||||
{ label: "众妙之门", value: 1, valueName: "isSociology" }
|
||||
],
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
query: {
|
||||
type: "",
|
||||
categoryId: "",
|
||||
sociologyId: "",
|
||||
keywords: ""
|
||||
},
|
||||
dataList: [],
|
||||
delFlag: false,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
urlList: {
|
||||
list: "/master/message/listByPage"
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated() {
|
||||
if (this.$route.query.upPageInde != null) {
|
||||
this.pageIndex = this.$route.query.upPageIndex;
|
||||
console.log(this.pageIndex);
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
console.log("this.selectQueryApp at line 195:", this.selectQueryApp);
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(this.urlList.list),
|
||||
method: "POST",
|
||||
data: {
|
||||
current: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
...this.query,
|
||||
// type: "", //0本地信息1外链
|
||||
isBook: this.selectQueryApp.includes("isBook") ? 1 : "", //是否是疯子读书
|
||||
isMedical: this.selectQueryApp.includes("isMedical") ? 1 : "", //是否是吴门医述
|
||||
isSociology: this.selectQueryApp.includes("isSociology") ? 1 : "" //是否是众妙之门
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.result.records;
|
||||
this.totalPage = data.result.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);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
this.$confirm(
|
||||
`确定对[id=${id}]进行[${id ? "删除" : "删除"}]操作?`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/message/delMessage?id=" + id),
|
||||
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 = {
|
||||
delFlag: event.delFlag,
|
||||
id: event.id
|
||||
};
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/book/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);
|
||||
},
|
||||
chapterHandle(id, row) {
|
||||
if (row.novel == "") {
|
||||
this.$alert("请上传电子书文件后在进行此操作", "提示", {
|
||||
confirmButtonText: "好的"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/book/getChapter"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
contentHandle(id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/bookchaptercontent/getBookVoices"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
voicesHandle(id) {
|
||||
//allVoices
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
|
||||
url: this.$http.adornUrl("/book/bookchaptercontent/AllVOices"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
id: id
|
||||
})
|
||||
}).then(res => {
|
||||
console.log("book/bookchaptercontent/AllVOices");
|
||||
this.$message({
|
||||
message: "成功",
|
||||
type: "success"
|
||||
});
|
||||
this.loading = false;
|
||||
this.getDataList();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -95,7 +95,7 @@
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'courseList'
|
||||
httpDataValueName: 'list'
|
||||
}"
|
||||
:defaultForm="{
|
||||
marketId: addForm.id
|
||||
@@ -150,13 +150,13 @@
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template slot="tableItem" slot-scope="slotProps">
|
||||
<el-table-column label="课程ID" width="70" align="center" prop="id">
|
||||
<el-table-column label="课程ID" width="70" align="center" prop="courseEntity.id">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
prop="courseEntity.title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="课程名称"
|
||||
@@ -171,14 +171,31 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
v-if="scope.row.image != ''"
|
||||
:src="scope.row.image"
|
||||
v-if="scope.row.courseEntity.image != ''"
|
||||
:src="scope.row.courseEntity.image"
|
||||
|
||||
width="25"
|
||||
height="35"
|
||||
class="tableImg"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="100"
|
||||
label="排序"
|
||||
>
|
||||
</el-table-column>
|
||||
</template> <template slot="operation" slot-scope="slotProps">
|
||||
<el-button
|
||||
type="text"
|
||||
|
||||
@click="dataFormEdit(slotProps.row)"
|
||||
size="mini"
|
||||
>修改排序</el-button
|
||||
>
|
||||
</template>
|
||||
</commonShop>
|
||||
|
||||
@@ -297,6 +314,51 @@
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
title="修改排序"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div class="addFormBox selectTimeBox">
|
||||
<el-form ref="addForm" :model="dataForm" label-width="80px">
|
||||
<slot name="searchFormItem" :dataForm="dataForm"></slot>
|
||||
|
||||
<el-form-item
|
||||
label="课程名称:"
|
||||
class="form_item"
|
||||
style="width: 100% !important"
|
||||
>
|
||||
<p class="input_item">
|
||||
{{ dataForm.title }}
|
||||
</p>
|
||||
<!-- selectCourse -->
|
||||
<!-- <el-input
|
||||
v-model="selectCourse.courseCatalogueTitle"
|
||||
readonly
|
||||
></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="排序:"
|
||||
class="form_item"
|
||||
style="width: 100% !important"
|
||||
>
|
||||
<el-input :min="0"
|
||||
v-model="dataForm.sort"
|
||||
type="number"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmitDataForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -310,6 +372,7 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
isEdit: false,
|
||||
checkAll: false,
|
||||
isIndeterminate: true,
|
||||
@@ -324,7 +387,8 @@ export default {
|
||||
hasBindProductList:
|
||||
"/master/courseSociologyMarket/getCourseListByMarketId",
|
||||
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
|
||||
},
|
||||
, editSort: "/master/courseSociologyMarket/editMarketSort",
|
||||
},
|
||||
addForm: {},
|
||||
isFresh: false,
|
||||
dataRule: {
|
||||
@@ -415,13 +479,57 @@ export default {
|
||||
this.isEdit = false;
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
methods: { handleClose() {
|
||||
this.dataForm = {};
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
UpNumber(e) {
|
||||
e.target.value = e.target.value.replace(/[^\d]/g, "");
|
||||
},
|
||||
dataFormEdit() {
|
||||
this.checkAll = false;
|
||||
this.isEdit = !this.isEdit;
|
||||
}, handleSubmitDataForm: debounce(async function() {
|
||||
var that = this;
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.editSort}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
marketId: this.dataForm.marketId,
|
||||
courseId: this.dataForm.courseId,
|
||||
|
||||
sort: Number(this.dataForm.sort)
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
if (this.$refs.commonShop) {
|
||||
this.$refs.commonShop.getAssociatedGoodsList({
|
||||
courseId: this.addForm.id
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
that.dialogVisible = false;
|
||||
});
|
||||
|
||||
that.$forceUpdate();
|
||||
}, 200),
|
||||
dataFormEdit(row) {
|
||||
console.log('row at line 523:', row)
|
||||
this.dataForm = {
|
||||
|
||||
marketId: row.sociologyMarketId,
|
||||
courseId: row.courseId,
|
||||
sort: row.sort,
|
||||
title: row.courseEntity.title
|
||||
};
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleCheckAllChange(val) {
|
||||
this.$nextTick(() => {
|
||||
@@ -572,7 +680,7 @@ export default {
|
||||
)
|
||||
.then(async () => {
|
||||
// var lableIds = row[0].bookLabelId;
|
||||
var productIds = row[0].id;
|
||||
var productIds = row[0].courseId;
|
||||
|
||||
// // return false
|
||||
// var selectShopArr = this.$refs.commonShop.selectShopArr;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mod-config">
|
||||
<commonTree
|
||||
source="tags"
|
||||
|
||||
axiosType="raw"
|
||||
axiosResultKey="market"
|
||||
@changeCurrentNode="changeCurrentNode"
|
||||
ref="commonTree"
|
||||
@@ -94,8 +94,8 @@
|
||||
<commonShop
|
||||
:isNoSearch="true"
|
||||
:otherInfo="{
|
||||
|
||||
httpDataValueName: 'courseList'
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'list'
|
||||
}"
|
||||
:defaultForm="{
|
||||
marketId: addForm.id
|
||||
@@ -150,13 +150,18 @@
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template slot="tableItem" slot-scope="slotProps">
|
||||
<el-table-column label="课程ID" width="70" align="center" prop="id">
|
||||
<el-table-column
|
||||
label="课程ID"
|
||||
width="70"
|
||||
align="center"
|
||||
prop="courseEntity.id"
|
||||
>
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
prop="courseEntity.title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="课程名称"
|
||||
@@ -171,14 +176,30 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
v-if="scope.row.image != ''"
|
||||
:src="scope.row.image"
|
||||
v-if="scope.row.courseEntity.image != ''"
|
||||
:src="scope.row.courseEntity.image"
|
||||
width="25"
|
||||
height="35"
|
||||
class="tableImg"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="100"
|
||||
label="排序"
|
||||
>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template slot="operation" slot-scope="slotProps">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="dataFormEdit(slotProps.row)"
|
||||
size="mini"
|
||||
>修改排序</el-button
|
||||
>
|
||||
</template>
|
||||
</commonShop>
|
||||
|
||||
@@ -224,13 +245,13 @@
|
||||
<commonShopTable
|
||||
title="课程"
|
||||
:otherInfo="{
|
||||
httpType:'raw',
|
||||
httpType: 'raw',
|
||||
httpDataValueName: 'records',
|
||||
httpDataTotalName: 'total'
|
||||
}"
|
||||
:defaultForm="{
|
||||
title: '',
|
||||
marketId: addForm.id
|
||||
keywords: '',
|
||||
id: addForm.id
|
||||
}"
|
||||
:urlList="urlList"
|
||||
:tableColumnList="tableColumnList"
|
||||
@@ -241,12 +262,12 @@
|
||||
@submit="handleSubmitShopTable"
|
||||
>
|
||||
<template slot="searchFormItem" slot-scope="slotProps">
|
||||
<el-form-item label="课程名称" prop="title" class="form_item">
|
||||
<el-form-item label="课程名称" prop="keywords" class="form_item">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入课程名称"
|
||||
style="width: 100%"
|
||||
v-model="slotProps.dataForm.title"
|
||||
v-model="slotProps.dataForm.keywords"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
@@ -297,6 +318,48 @@
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
title="修改排序"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div class="addFormBox selectTimeBox">
|
||||
<el-form ref="addForm" :model="dataForm" label-width="80px">
|
||||
<slot name="searchFormItem" :dataForm="dataForm"></slot>
|
||||
|
||||
<el-form-item
|
||||
label="课程名称:"
|
||||
class="form_item"
|
||||
style="width: 100% !important"
|
||||
>
|
||||
<p class="input_item">
|
||||
{{ dataForm.title }}
|
||||
</p>
|
||||
<!-- selectCourse -->
|
||||
<!-- <el-input
|
||||
v-model="selectCourse.courseCatalogueTitle"
|
||||
readonly
|
||||
></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="排序:"
|
||||
class="form_item"
|
||||
style="width: 100% !important"
|
||||
>
|
||||
<el-input :min="0" v-model="dataForm.sort" type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmitDataForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -310,6 +373,7 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
isEdit: false,
|
||||
checkAll: false,
|
||||
isIndeterminate: true,
|
||||
@@ -317,13 +381,13 @@ export default {
|
||||
treeList: "/master/courseMedicineMarket/marketTree",
|
||||
delete: "/master/courseMedicineMarket/delMarket",
|
||||
deleteShop:
|
||||
"/master/courseMedicineMarket/delToMarket",
|
||||
saveShop: "/master/courseMedicineMarket/saveToMarket",
|
||||
add: "/master/courseMedicineMarket/saveOrUpdateMarket",
|
||||
edit: "/master/courseMedicineMarket/saveOrUpdateMarket",
|
||||
getAssociatedGoodsList:
|
||||
"/master/courseMedicineMarket/getCourseByMarketId",
|
||||
getNotToLabelList: "/master/courseMedicineMarket/getNotToMarketList"
|
||||
"/master/courseMedicineMarket/unbindCourseAndMedicineMarket",
|
||||
saveShop: "/master/courseMedicineMarket/bindCourseAndMedicineMarket",
|
||||
add: "/master/courseMedicineMarket/addSociologyMarket",
|
||||
edit: "/master/courseMedicineMarket/editSociologyMarket",
|
||||
hasBindProductList: "/master/courseMedicineMarket/getCourseByMarketId",
|
||||
CanBindProductList: "/master/courseMedicineMarket/getNotToMarketList",
|
||||
editSort: "/master/courseMedicineMarket/editMarketSort"
|
||||
},
|
||||
addForm: {},
|
||||
isFresh: false,
|
||||
@@ -416,12 +480,57 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.dataForm = {};
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
handleSubmitDataForm: debounce(async function() {
|
||||
var that = this;
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.editSort}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
marketId: this.dataForm.marketId,
|
||||
courseId: this.dataForm.courseId,
|
||||
|
||||
sort: Number(this.dataForm.sort)
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
|
||||
.then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
|
||||
if (this.$refs.commonShop) {
|
||||
this.$refs.commonShop.getAssociatedGoodsList({
|
||||
courseId: this.addForm.id
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
that.dialogVisible = false;
|
||||
});
|
||||
|
||||
that.$forceUpdate();
|
||||
}, 200),
|
||||
UpNumber(e) {
|
||||
e.target.value = e.target.value.replace(/[^\d]/g, "");
|
||||
},
|
||||
dataFormEdit() {
|
||||
this.checkAll = false;
|
||||
this.isEdit = !this.isEdit;
|
||||
dataFormEdit(row) {
|
||||
this.dataForm = {
|
||||
|
||||
marketId: row.medicineMarketId,
|
||||
courseId: row.courseId,
|
||||
sort: row.sort,
|
||||
title: row.courseEntity.title
|
||||
};
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleCheckAllChange(val) {
|
||||
this.$nextTick(() => {
|
||||
@@ -532,10 +641,10 @@ export default {
|
||||
await this.getDataList();
|
||||
|
||||
this.$nextTick(async () => {
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.result.id);
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.market.id);
|
||||
|
||||
this.addForm = data.result;
|
||||
this.currentNode = { data: { ...data.result } };
|
||||
this.addForm = data.market;
|
||||
this.currentNode = { data: { ...data.market } };
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
@@ -547,9 +656,9 @@ export default {
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
setTimeout(()=>{
|
||||
this.addForm = { ...this.currentNode.data };
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
this.addForm = { ...this.currentNode.data };
|
||||
}, 500);
|
||||
|
||||
// console.log('this.addForm at line 550:', this.addForm)
|
||||
// console.log('this.addForm at line 550:', this.currentNode)
|
||||
@@ -572,7 +681,7 @@ export default {
|
||||
)
|
||||
.then(async () => {
|
||||
// var lableIds = row[0].bookLabelId;
|
||||
var productIds = row[0].id;
|
||||
var productIds = row[0].courseId;
|
||||
|
||||
// // return false
|
||||
// var selectShopArr = this.$refs.commonShop.selectShopArr;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
>
|
||||
<div class="title_box" style="margin-bottom: 10px; height: 40px">
|
||||
<div class="title">
|
||||
<span class="line"></span>已绑定课程列表
|
||||
<span class="line"></span>已关联课程列表
|
||||
<el-button
|
||||
plain
|
||||
type="primary"
|
||||
@@ -289,10 +289,10 @@ export default {
|
||||
UpNumber(e) {
|
||||
e.target.value = e.target.value.replace(/[^\d]/g, "");
|
||||
},
|
||||
dataFormEdit() {
|
||||
this.checkAll = false;
|
||||
this.isEdit = !this.isEdit;
|
||||
},
|
||||
// dataFormEdit() {
|
||||
// this.checkAll = false;
|
||||
// this.isEdit = !this.isEdit;
|
||||
// },
|
||||
handleCheckAllChange(val) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.commonShop.handleCheckAllChange(val);
|
||||
|
||||
@@ -1,274 +1,246 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
@close="handlereset">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="120px">
|
||||
<el-form-item label="课程说明名称" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="章节名"></el-input>
|
||||
</el-form-item>
|
||||
<div style="height: 100%;">
|
||||
<div style="height: calc(100% - 120px);margin-bottom: 80px;">
|
||||
<el-upload
|
||||
class="chapter-avatar-uploader"
|
||||
:action="baseUrl + '/oss/fileoss'"
|
||||
accept=".jpeg,.jpg,.gif,.png"
|
||||
:show-file-list="false"
|
||||
:on-success="contentUploadSuccess"
|
||||
>
|
||||
</el-upload>
|
||||
<quill-editor
|
||||
v-model="dataForm.content"
|
||||
ref="myQuillEditor"
|
||||
:options="editorOption"
|
||||
@blur="onEditorBlur($event)"
|
||||
@focus="onEditorFocus($event)"
|
||||
@ready="onEditorReady($event)"
|
||||
class="chapter_editor"
|
||||
style="height: 100%;"
|
||||
>
|
||||
</quill-editor>
|
||||
</div>
|
||||
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> -->
|
||||
|
||||
<el-form-item label="插图" prop="imgUrl">
|
||||
<el-upload :action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
||||
:file-list="fileList" :on-success="handlePicSuccess" :on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.imgUrl" alt="">
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content" class="custom-chapter-height">
|
||||
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> -->
|
||||
<el-upload class="chapter-avatar-uploader" :action="baseUrl + '/oss/fileoss'" accept=".jpeg,.jpg,.gif,.png" :show-file-list="false" :on-success="contentUploadSuccess" >
|
||||
</el-upload>
|
||||
<quill-editor v-model="dataForm.content" ref="myQuillEditor" :options="editorOption"
|
||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
|
||||
@ready="onEditorReady($event)" class="chapter_editor">
|
||||
</quill-editor>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handlereset">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- <el-button @click="handlereset">取消</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()" style="float: right;"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import global from '../../common/common.vue' //引入共用组间
|
||||
import {
|
||||
quillEditor
|
||||
} from 'vue-quill-editor'
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
const toolbarOptions = [
|
||||
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
|
||||
['blockquote', 'code-block'], //引用,代码块
|
||||
[{ 'header': 1 }, { 'header': 2 }], // 几级标题
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
|
||||
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
|
||||
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
|
||||
[{ 'direction': 'rtl' }], // 文字输入方向
|
||||
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
|
||||
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
|
||||
[{ 'color': [] }, { 'background': [] }], // 颜色选择
|
||||
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
|
||||
[{ 'align': [] }], // 居中
|
||||
['clean'], // 清除样式,
|
||||
['link', 'image'], // 上传图片、上传视频
|
||||
]
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
// 富文本编辑器配置
|
||||
editorOption: {
|
||||
modules: {
|
||||
history: {
|
||||
delay: 1000,
|
||||
maxStack: 50,
|
||||
userOnly: false
|
||||
},
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
handlers: {
|
||||
image: function (value) {
|
||||
if (value) {
|
||||
// 调用element的图片上传组件
|
||||
document.querySelector('.chapter-avatar-uploader input').click()
|
||||
} else {
|
||||
this.quill.format('image', false)
|
||||
}
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||
["blockquote", "code-block"], //引用,代码块
|
||||
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ direction: "rtl" }], // 文字输入方向
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 颜色选择
|
||||
[
|
||||
{
|
||||
font: [
|
||||
"SimSun",
|
||||
"SimHei",
|
||||
"Microsoft-YaHei",
|
||||
"KaiTi",
|
||||
"FangSong",
|
||||
"Arial"
|
||||
]
|
||||
}
|
||||
], // 字体
|
||||
[{ align: [] }], // 居中
|
||||
["clean"], // 清除样式,
|
||||
["link", "image"] // 上传图片、上传视频
|
||||
];
|
||||
export default {
|
||||
props: ["dataInfo", "type"],
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
// 富文本编辑器配置
|
||||
editorOption: {
|
||||
modules: {
|
||||
history: {
|
||||
delay: 1000,
|
||||
maxStack: 50,
|
||||
userOnly: false
|
||||
},
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
handlers: {
|
||||
image: function(value) {
|
||||
if (value) {
|
||||
// 调用element的图片上传组件
|
||||
document
|
||||
.querySelector(".chapter-avatar-uploader input")
|
||||
.click();
|
||||
} else {
|
||||
this.quill.format("image", false);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
placeholder: '请输入正文',
|
||||
}
|
||||
}
|
||||
},
|
||||
visible: false,
|
||||
props: {
|
||||
dictType: '',
|
||||
dictValue: ''
|
||||
},
|
||||
gushuList:[],
|
||||
authorList: [],
|
||||
restaurants: [],
|
||||
author: '',
|
||||
publisherList: [],
|
||||
fileList: [],
|
||||
fileListNovel: [],
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
dataForm: {
|
||||
"courseId": 0,
|
||||
"catalogueId": 0,
|
||||
"title": "",
|
||||
"imgUrl": "",
|
||||
"content": "",
|
||||
"sort": 1,
|
||||
},
|
||||
splitsTypeList: [],
|
||||
dataRule: {
|
||||
placeholder: "请输入" + this.dataInfo.label
|
||||
},
|
||||
visible: false,
|
||||
props: {
|
||||
dictType: "",
|
||||
dictValue: ""
|
||||
},
|
||||
gushuList: [],
|
||||
authorList: [],
|
||||
restaurants: [],
|
||||
author: "",
|
||||
publisherList: [],
|
||||
fileList: [],
|
||||
fileListNovel: [],
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
dataForm: {
|
||||
|
||||
content: "",
|
||||
|
||||
}
|
||||
},
|
||||
splitsTypeList: [],
|
||||
dataRule: {}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
contentUploadSuccess(res, file) {
|
||||
// console.log(res)
|
||||
let quill = this.$refs.myQuillEditor.quill;
|
||||
// 如果上传成功
|
||||
if (res) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片,res为服务器返回的图片链接地址
|
||||
quill.insertEmbed(length, "image", res.url);
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1);
|
||||
} else {
|
||||
// 提示信息,需引入Message
|
||||
this.$message.error("图片插入失败!");
|
||||
}
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
contentUploadSuccess(res, file) {
|
||||
// console.log(res)
|
||||
let quill = this.$refs.myQuillEditor.quill
|
||||
// 如果上传成功
|
||||
if (res) {
|
||||
// 获取光标所在位置
|
||||
let length = quill.getSelection().index;
|
||||
// 插入图片,res为服务器返回的图片链接地址
|
||||
quill.insertEmbed(length, 'image', res.url)
|
||||
// 调整光标到最后
|
||||
quill.setSelection(length + 1)
|
||||
} else {
|
||||
// 提示信息,需引入Message
|
||||
this.$message.error('图片插入失败!')
|
||||
}
|
||||
|
||||
},
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
// console.log('editor blur!', quill)
|
||||
},
|
||||
// 获得焦点事件
|
||||
onEditorFocus(quill) {
|
||||
//console.log('editor focus!', quill)
|
||||
},
|
||||
// 准备富文本编辑器
|
||||
onEditorReady(quill) {
|
||||
// console.log('editor ready!', quill)
|
||||
},
|
||||
init(row, catalogue_id, courseid) {
|
||||
console.log('row21', row)
|
||||
this.dataForm =row? JSON.parse(JSON.stringify(row)): {}
|
||||
this.dataForm.courseId = courseid?courseid : ''
|
||||
this.dataForm.catalogueId = catalogue_id?catalogue_id : ''
|
||||
this.visible = true
|
||||
if (this.dataForm.imgUrl && this.dataForm.imgUrl != "") {
|
||||
var img = {
|
||||
name: '',
|
||||
url: this.dataForm.imgUrl
|
||||
}
|
||||
var attr = []
|
||||
attr.push(img)
|
||||
this.fileList = attr
|
||||
}else{
|
||||
this.fileList = []
|
||||
}
|
||||
},
|
||||
// 获得焦点事件
|
||||
onEditorFocus(quill) {
|
||||
//console.log('editor focus!', quill)
|
||||
},
|
||||
// 准备富文本编辑器
|
||||
onEditorReady(quill) {
|
||||
// console.log('editor ready!', quill)
|
||||
},
|
||||
init(content) {
|
||||
console.log("row21", content);
|
||||
this.dataForm.content=content
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`${!this.dataForm.id ? '/master/course/addCourseCatalogueChapter' : '/master/course/editCourseCatalogueChapter'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
"id": this.dataForm.id || undefined,
|
||||
'courseId': this.dataForm.courseId || undefined,
|
||||
'catalogueId': this.dataForm.catalogueId || undefined,
|
||||
'title': this.dataForm.title,
|
||||
"imgUrl": this.dataForm.imgUrl,
|
||||
"content": this.dataForm.content,
|
||||
"sort": this.dataForm.sort,
|
||||
})
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getContent(){
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/course/editCourseRecord"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
type: this.type,
|
||||
recordType: this.dataInfo.id, //0 buy_record , 1 use_record , 2 study_record, 3 vip_record
|
||||
content: this.dataForm.content
|
||||
})
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.imgUrl = res.url;
|
||||
this.$message.success("上传成功");
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
},
|
||||
handleRemove(file) {
|
||||
this.dataForm.imgUrl = '';
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dataForm.imgUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleDownload(file) {
|
||||
console.log(file)
|
||||
},
|
||||
handlereset() {
|
||||
this.fileList = [],
|
||||
this.fileListNovel = [],
|
||||
this.visible = false
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
},
|
||||
handleRemoveNovel(file) {
|
||||
this.dataForm.novel = '';
|
||||
},
|
||||
handleNovelSuccess(file) {
|
||||
this.dataForm.novel = file.url
|
||||
},
|
||||
// querySearch(queryString, cb) {
|
||||
// var restaurants = this.restaurants;
|
||||
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
||||
// // 调用 callback 返回建议列表的数据
|
||||
// console.log(results)
|
||||
// cb(results);
|
||||
// },
|
||||
// createFilter(queryString) {
|
||||
// return (restaurant) => {
|
||||
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
// };
|
||||
// },
|
||||
// handleSelect(item) {
|
||||
// this.dataForm.authorId = item.id
|
||||
// console.log(item);
|
||||
// }
|
||||
});
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.imgUrl = res.url;
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
handleRemove(file) {
|
||||
this.dataForm.imgUrl = "";
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dataForm.imgUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleDownload(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handlereset() {
|
||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(
|
||||
`当前限制选择 3 个文件,本次选择了 ${
|
||||
files.length
|
||||
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
||||
);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`);
|
||||
},
|
||||
handleRemoveNovel(file) {
|
||||
this.dataForm.novel = "";
|
||||
},
|
||||
handleNovelSuccess(file) {
|
||||
this.dataForm.novel = file.url;
|
||||
}
|
||||
|
||||
// querySearch(queryString, cb) {
|
||||
// var restaurants = this.restaurants;
|
||||
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
||||
// // 调用 callback 返回建议列表的数据
|
||||
// console.log(results)
|
||||
// cb(results);
|
||||
// },
|
||||
// createFilter(queryString) {
|
||||
// return (restaurant) => {
|
||||
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
// };
|
||||
// },
|
||||
// handleSelect(item) {
|
||||
// this.dataForm.authorId = item.id
|
||||
// console.log(item);
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,127 +1,24 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<!-- <el-form-item label="课程目录章节名称">
|
||||
<el-input v-model="query.keywords" placeholder="课程目录章节名称" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
> -->
|
||||
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%;"
|
||||
<div class="mod-config" style="height: calc(100vh - 180px)">
|
||||
<el-tabs tab-position="left" style="height: 100%;" v-model="currentTab"@tab-click="handleClick">
|
||||
<el-tab-pane
|
||||
|
||||
>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="课程说明名称"
|
||||
:label="v.label"
|
||||
v-for="(v, i) in setList"
|
||||
:key="i"
|
||||
style="height: 100%;"
|
||||
>
|
||||
</el-table-column>
|
||||
<add-or-update
|
||||
:dataInfo="v"
|
||||
:type="type"
|
||||
style="height: calc(100vh - 180px)"
|
||||
:ref="`addOrUpdate${v.id}`"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- <el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建日期"
|
||||
>
|
||||
</el-table-column> -->
|
||||
<el-table-column header-align="center" align="center" label="图片">
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
v-if="scope.row.imgUrl != ''"
|
||||
:src="scope.row.imgUrl"
|
||||
width="70"
|
||||
height="100"
|
||||
class="tableImg"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="内容"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="hidden1">
|
||||
{{ scope.row.content }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
width="100"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="排序"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="250"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<router-link
|
||||
:to="{
|
||||
path: 'course-courseVideo',
|
||||
query: { id: scope.row.id, pageIndex }
|
||||
}"
|
||||
>
|
||||
<el-button type="text" size="small">视频管理</el-button>
|
||||
</router-link>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
</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>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -130,6 +27,14 @@ import AddOrUpdate from "./chapter-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentTab: 0,
|
||||
type: 0,
|
||||
setList: [
|
||||
{ label: "购买须知", id: 0 },
|
||||
{ label: "使用须知", id: 1 },
|
||||
{ label: "学习次序", id: 2 },
|
||||
{ label: "超V用户", id: 3 }
|
||||
],
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
@@ -164,33 +69,53 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
this.getDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
"/master/course/getCourseCatalogueChapterList"
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: this.catalogue_id,
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize
|
||||
// "type": this.query.type||0, //类型0全部,1:医学,2:国学
|
||||
// "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
|
||||
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
|
||||
// "keywords": this.query.keywords //关键字
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`/master/course/getCourseRecord`),
|
||||
method: "POST",
|
||||
data: {
|
||||
type: this.type
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
}).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;
|
||||
});
|
||||
.then(({ data }) => {
|
||||
var that=this
|
||||
console.log("data at line 86:", data);
|
||||
if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
|
||||
var content=''
|
||||
switch (that.currentTab) {
|
||||
|
||||
case "0":
|
||||
content=data.result.buyRecord
|
||||
break;
|
||||
case "1":
|
||||
content=data.result.useRecord
|
||||
break;
|
||||
case "2":
|
||||
content=data.result.studyRecord
|
||||
|
||||
break;
|
||||
case "3":
|
||||
content=data.result.vipRecord
|
||||
|
||||
break;
|
||||
}
|
||||
that.$nextTick(()=>{
|
||||
that.$refs[`addOrUpdate${that.currentTab}`][0].init(content);
|
||||
})
|
||||
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
@@ -344,8 +269,11 @@ export default {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
|
||||
-webkit-line-clamp:1;
|
||||
-webkit-line-clamp: 1;
|
||||
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
::v-deep .mod-config .el-tabs .el-tabs__content {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,127 +1,24 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<!-- <el-form-item label="课程目录章节名称">
|
||||
<el-input v-model="query.keywords" placeholder="课程目录章节名称" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
> -->
|
||||
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%;"
|
||||
<div class="mod-config" style="height: calc(100vh - 180px)">
|
||||
<el-tabs tab-position="left" style="height: 100%;" v-model="currentTab"@tab-click="handleClick">
|
||||
<el-tab-pane
|
||||
|
||||
>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="课程说明名称"
|
||||
:label="v.label"
|
||||
v-for="(v, i) in setList"
|
||||
:key="i"
|
||||
style="height: 100%;"
|
||||
>
|
||||
</el-table-column>
|
||||
<add-or-update
|
||||
:dataInfo="v"
|
||||
:type="type"
|
||||
style="height: calc(100vh - 180px)"
|
||||
:ref="`addOrUpdate${v.id}`"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- <el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建日期"
|
||||
>
|
||||
</el-table-column> -->
|
||||
<el-table-column header-align="center" align="center" label="图片">
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
v-if="scope.row.imgUrl != ''"
|
||||
:src="scope.row.imgUrl"
|
||||
width="70"
|
||||
height="100"
|
||||
class="tableImg"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="内容"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="hidden1">
|
||||
{{ scope.row.content }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
width="100"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="排序"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="250"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<router-link
|
||||
:to="{
|
||||
path: 'course-courseVideo',
|
||||
query: { id: scope.row.id, pageIndex }
|
||||
}"
|
||||
>
|
||||
<el-button type="text" size="small">视频管理</el-button>
|
||||
</router-link>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
</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>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -130,6 +27,15 @@ import AddOrUpdate from "./chapter-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
currentTab: 0,
|
||||
type: 1,
|
||||
setList: [
|
||||
{ label: "购买须知", id: 0 },
|
||||
{ label: "使用须知", id: 1 },
|
||||
{ label: "学习次序", id: 2 },
|
||||
{ label: "超V用户", id: 3 }
|
||||
],
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
@@ -164,33 +70,55 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
|
||||
this.getDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
"/master/course/getCourseCatalogueChapterList"
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: this.catalogue_id,
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize
|
||||
// "type": this.query.type||0, //类型0全部,1:医学,2:国学
|
||||
// "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
|
||||
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
|
||||
// "keywords": this.query.keywords //关键字
|
||||
this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`/master/course/getCourseRecord`),
|
||||
method: "POST",
|
||||
data: {
|
||||
type: this.type
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
}).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;
|
||||
});
|
||||
.then(({ data }) => {
|
||||
var that=this
|
||||
console.log("data at line 86:", data);
|
||||
if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
|
||||
var content=''
|
||||
switch (that.currentTab) {
|
||||
|
||||
case "0":
|
||||
content=data.result.buyRecord
|
||||
break;
|
||||
case "1":
|
||||
content=data.result.useRecord
|
||||
break;
|
||||
case "2":
|
||||
content=data.result.studyRecord
|
||||
|
||||
break;
|
||||
case "3":
|
||||
content=data.result.vipRecord
|
||||
|
||||
break;
|
||||
}
|
||||
that.$nextTick(()=>{
|
||||
this.content=content
|
||||
that.$refs[`addOrUpdate${that.currentTab}`][0].init(content);
|
||||
})
|
||||
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
@@ -344,8 +272,11 @@ export default {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
|
||||
-webkit-line-clamp:1;
|
||||
-webkit-line-clamp: 1;
|
||||
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
::v-deep .mod-config .el-tabs .el-tabs__content {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -40,7 +40,33 @@
|
||||
import {
|
||||
quillEditor
|
||||
} from 'vue-quill-editor'
|
||||
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||
["blockquote", "code-block"], //引用,代码块
|
||||
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ direction: "rtl" }], // 文字输入方向
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 颜色选择
|
||||
[
|
||||
{
|
||||
font: [
|
||||
"SimSun",
|
||||
"SimHei",
|
||||
"Microsoft-YaHei",
|
||||
"KaiTi",
|
||||
"FangSong",
|
||||
"Arial"
|
||||
]
|
||||
}
|
||||
], // 字体
|
||||
[{ align: [] }], // 居中
|
||||
["clean"], // 清除样式,
|
||||
["link", "image"] // 上传图片、上传视频
|
||||
];
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
@@ -88,50 +114,10 @@
|
||||
],
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
||||
['blockquote', 'code-block'], // 引用 代码块
|
||||
[{
|
||||
header: 1
|
||||
}, {
|
||||
header: 2
|
||||
}], // 1、2 级标题
|
||||
[{
|
||||
list: 'ordered'
|
||||
}, {
|
||||
list: 'bullet'
|
||||
}], // 有序、无序列表
|
||||
[{
|
||||
script: 'sub'
|
||||
}, {
|
||||
script: 'super'
|
||||
}], // 上标/下标
|
||||
[{
|
||||
indent: '-1'
|
||||
}, {
|
||||
indent: '+1'
|
||||
}], // 缩进
|
||||
[{
|
||||
direction: 'rtl'
|
||||
}], // 文本方向
|
||||
[{
|
||||
size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36']
|
||||
}], // 字体大小
|
||||
[{
|
||||
header: [1, 2, 3, 4, 5, 6]
|
||||
}], // 标题
|
||||
[{
|
||||
color: []
|
||||
}, {
|
||||
background: []
|
||||
}], // 字体颜色、字体背景颜色
|
||||
// [{ font: ['songti'] }], // 字体种类
|
||||
[{
|
||||
align: []
|
||||
}], // 对齐方式
|
||||
['clean'], // 清除文本格式
|
||||
['image', 'video'] // 链接、图片、视频
|
||||
]
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
|
||||
}
|
||||
},
|
||||
placeholder: '请输入正文'
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// 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://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://192.168.110.100:9200/pb';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user