This commit is contained in:
@fawn-nine
2024-05-27 09:31:01 +08:00
13 changed files with 2690 additions and 636 deletions

View File

@@ -68,6 +68,7 @@
style="width: 100%" style="width: 100%"
> >
<slot name="tableItem"></slot> <slot name="tableItem"></slot>
<!-- <el-table-column <!-- <el-table-column
:reserve-selection="true" :reserve-selection="true"
type="selection" type="selection"
@@ -82,9 +83,11 @@
header-align="center" header-align="center"
align="center" align="center"
label="操作" label="操作"
width="80"
width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="operation" :row="scope.row"></slot>
<el-button <el-button
type="text" type="text"
style="color: red;" style="color: red;"
@@ -322,12 +325,36 @@ export default {
this.dataListLoading = true; 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 this.$http
.request({ .request({
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`), url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
method: "POST", method: "POST",
data: { data: {
...form ...form
}, },
header: { header: {

View File

@@ -248,6 +248,7 @@ export default {
this.clear(); this.clear();
if (this.otherInfo.httpType == "raw") { if (this.otherInfo.httpType == "raw") {
form.page = this.pageIndex; form.page = this.pageIndex;
form.current = this.pageIndex;
this.$http this.$http
.request({ .request({
url: this.$http.adornUrl(`${this.urlList.CanBindProductList}`), url: this.$http.adornUrl(`${this.urlList.CanBindProductList}`),

View 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>

View 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

View File

@@ -95,7 +95,7 @@
:isNoSearch="true" :isNoSearch="true"
:otherInfo="{ :otherInfo="{
httpType: 'raw', httpType: 'raw',
httpDataValueName: 'courseList' httpDataValueName: 'list'
}" }"
:defaultForm="{ :defaultForm="{
marketId: addForm.id marketId: addForm.id
@@ -150,13 +150,13 @@
</el-form-item> --> </el-form-item> -->
</template> </template>
<template slot="tableItem" slot-scope="slotProps"> <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"> <!-- <template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }} {{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template> --> </template> -->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="title" prop="courseEntity.title"
header-align="center" header-align="center"
align="center" align="center"
label="课程名称" label="课程名称"
@@ -171,14 +171,31 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<img <img
v-if="scope.row.image != ''" v-if="scope.row.courseEntity.image != ''"
:src="scope.row.image" :src="scope.row.courseEntity.image"
width="25" width="25"
height="35" height="35"
class="tableImg" class="tableImg"
/> />
</template> </template>
</el-table-column> </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> </template>
</commonShop> </commonShop>
@@ -297,6 +314,51 @@
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></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> </div>
</template> </template>
@@ -310,6 +372,7 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
export default { export default {
data() { data() {
return { return {
dialogVisible: false,
isEdit: false, isEdit: false,
checkAll: false, checkAll: false,
isIndeterminate: true, isIndeterminate: true,
@@ -324,6 +387,7 @@ export default {
hasBindProductList: hasBindProductList:
"/master/courseSociologyMarket/getCourseListByMarketId", "/master/courseSociologyMarket/getCourseListByMarketId",
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList" CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
, editSort: "/master/courseSociologyMarket/editMarketSort",
}, },
addForm: {}, addForm: {},
isFresh: false, isFresh: false,
@@ -415,13 +479,57 @@ export default {
this.isEdit = false; this.isEdit = false;
this.getDataList(); this.getDataList();
}, },
methods: { methods: { handleClose() {
this.dataForm = {};
this.dialogVisible = false;
},
UpNumber(e) { UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, ""); e.target.value = e.target.value.replace(/[^\d]/g, "");
}, 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)
}, },
dataFormEdit() { header: {
this.checkAll = false; //默认 无 说明:请求头
this.isEdit = !this.isEdit; "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) { handleCheckAllChange(val) {
this.$nextTick(() => { this.$nextTick(() => {
@@ -572,7 +680,7 @@ export default {
) )
.then(async () => { .then(async () => {
// var lableIds = row[0].bookLabelId; // var lableIds = row[0].bookLabelId;
var productIds = row[0].id; var productIds = row[0].courseId;
// // return false // // return false
// var selectShopArr = this.$refs.commonShop.selectShopArr; // var selectShopArr = this.$refs.commonShop.selectShopArr;

View File

@@ -2,7 +2,7 @@
<div class="mod-config"> <div class="mod-config">
<commonTree <commonTree
source="tags" source="tags"
axiosType="raw"
axiosResultKey="market" axiosResultKey="market"
@changeCurrentNode="changeCurrentNode" @changeCurrentNode="changeCurrentNode"
ref="commonTree" ref="commonTree"
@@ -94,8 +94,8 @@
<commonShop <commonShop
:isNoSearch="true" :isNoSearch="true"
:otherInfo="{ :otherInfo="{
httpType: 'raw',
httpDataValueName: 'courseList' httpDataValueName: 'list'
}" }"
:defaultForm="{ :defaultForm="{
marketId: addForm.id marketId: addForm.id
@@ -150,13 +150,18 @@
</el-form-item> --> </el-form-item> -->
</template> </template>
<template slot="tableItem" slot-scope="slotProps"> <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"> <!-- <template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }} {{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template> --> </template> -->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="title" prop="courseEntity.title"
header-align="center" header-align="center"
align="center" align="center"
label="课程名称" label="课程名称"
@@ -171,14 +176,30 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<img <img
v-if="scope.row.image != ''" v-if="scope.row.courseEntity.image != ''"
:src="scope.row.image" :src="scope.row.courseEntity.image"
width="25" width="25"
height="35" height="35"
class="tableImg" class="tableImg"
/> />
</template> </template>
</el-table-column> </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> </template>
</commonShop> </commonShop>
@@ -224,13 +245,13 @@
<commonShopTable <commonShopTable
title="课程" title="课程"
:otherInfo="{ :otherInfo="{
httpType:'raw', httpType: 'raw',
httpDataValueName: 'records', httpDataValueName: 'records',
httpDataTotalName: 'total' httpDataTotalName: 'total'
}" }"
:defaultForm="{ :defaultForm="{
title: '', keywords: '',
marketId: addForm.id id: addForm.id
}" }"
:urlList="urlList" :urlList="urlList"
:tableColumnList="tableColumnList" :tableColumnList="tableColumnList"
@@ -241,12 +262,12 @@
@submit="handleSubmitShopTable" @submit="handleSubmitShopTable"
> >
<template slot="searchFormItem" slot-scope="slotProps"> <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 <el-input
size="small" size="small"
placeholder="请输入课程名称" placeholder="请输入课程名称"
style="width: 100%" style="width: 100%"
v-model="slotProps.dataForm.title" v-model="slotProps.dataForm.keywords"
clearable clearable
> >
</el-input> </el-input>
@@ -297,6 +318,48 @@
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></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> </div>
</template> </template>
@@ -310,6 +373,7 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
export default { export default {
data() { data() {
return { return {
dialogVisible: false,
isEdit: false, isEdit: false,
checkAll: false, checkAll: false,
isIndeterminate: true, isIndeterminate: true,
@@ -317,13 +381,13 @@ export default {
treeList: "/master/courseMedicineMarket/marketTree", treeList: "/master/courseMedicineMarket/marketTree",
delete: "/master/courseMedicineMarket/delMarket", delete: "/master/courseMedicineMarket/delMarket",
deleteShop: deleteShop:
"/master/courseMedicineMarket/delToMarket", "/master/courseMedicineMarket/unbindCourseAndMedicineMarket",
saveShop: "/master/courseMedicineMarket/saveToMarket", saveShop: "/master/courseMedicineMarket/bindCourseAndMedicineMarket",
add: "/master/courseMedicineMarket/saveOrUpdateMarket", add: "/master/courseMedicineMarket/addSociologyMarket",
edit: "/master/courseMedicineMarket/saveOrUpdateMarket", edit: "/master/courseMedicineMarket/editSociologyMarket",
getAssociatedGoodsList: hasBindProductList: "/master/courseMedicineMarket/getCourseByMarketId",
"/master/courseMedicineMarket/getCourseByMarketId", CanBindProductList: "/master/courseMedicineMarket/getNotToMarketList",
getNotToLabelList: "/master/courseMedicineMarket/getNotToMarketList" editSort: "/master/courseMedicineMarket/editMarketSort"
}, },
addForm: {}, addForm: {},
isFresh: false, isFresh: false,
@@ -416,12 +480,57 @@ export default {
this.getDataList(); this.getDataList();
}, },
methods: { 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) { UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, ""); e.target.value = e.target.value.replace(/[^\d]/g, "");
}, },
dataFormEdit() { dataFormEdit(row) {
this.checkAll = false; this.dataForm = {
this.isEdit = !this.isEdit;
marketId: row.medicineMarketId,
courseId: row.courseId,
sort: row.sort,
title: row.courseEntity.title
};
this.dialogVisible = true;
}, },
handleCheckAllChange(val) { handleCheckAllChange(val) {
this.$nextTick(() => { this.$nextTick(() => {
@@ -532,10 +641,10 @@ export default {
await this.getDataList(); await this.getDataList();
this.$nextTick(async () => { this.$nextTick(async () => {
this.$refs.commonTree.setCurrentNodeShow(data.result.id); this.$refs.commonTree.setCurrentNodeShow(data.market.id);
this.addForm = data.result; this.addForm = data.market;
this.currentNode = { data: { ...data.result } }; this.currentNode = { data: { ...data.market } };
this.$message({ this.$message({
message: "操作成功", message: "操作成功",
type: "success", type: "success",
@@ -547,9 +656,9 @@ export default {
}); });
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg);
setTimeout(()=>{ setTimeout(() => {
this.addForm = { ...this.currentNode.data }; this.addForm = { ...this.currentNode.data };
},500) }, 500);
// console.log('this.addForm at line 550:', this.addForm) // console.log('this.addForm at line 550:', this.addForm)
// console.log('this.addForm at line 550:', this.currentNode) // console.log('this.addForm at line 550:', this.currentNode)
@@ -572,7 +681,7 @@ export default {
) )
.then(async () => { .then(async () => {
// var lableIds = row[0].bookLabelId; // var lableIds = row[0].bookLabelId;
var productIds = row[0].id; var productIds = row[0].courseId;
// // return false // // return false
// var selectShopArr = this.$refs.commonShop.selectShopArr; // var selectShopArr = this.$refs.commonShop.selectShopArr;

View File

@@ -72,7 +72,7 @@
> >
<div class="title_box" style="margin-bottom: 10px; height: 40px"> <div class="title_box" style="margin-bottom: 10px; height: 40px">
<div class="title"> <div class="title">
<span class="line"></span>绑定课程列表 <span class="line"></span>关联课程列表
<el-button <el-button
plain plain
type="primary" type="primary"
@@ -289,10 +289,10 @@ export default {
UpNumber(e) { UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, ""); e.target.value = e.target.value.replace(/[^\d]/g, "");
}, },
dataFormEdit() { // dataFormEdit() {
this.checkAll = false; // this.checkAll = false;
this.isEdit = !this.isEdit; // this.isEdit = !this.isEdit;
}, // },
handleCheckAllChange(val) { handleCheckAllChange(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.commonShop.handleCheckAllChange(val); this.$refs.commonShop.handleCheckAllChange(val);

View File

@@ -1,71 +1,70 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" <div style="height: 100%;">
@close="handlereset"> <div style="height: calc(100% - 120px);margin-bottom: 80px;">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="120px"> <el-upload
<el-form-item label="课程说明名称" prop="title"> class="chapter-avatar-uploader"
<el-input v-model="dataForm.title" placeholder="章节名"></el-input> :action="baseUrl + '/oss/fileoss'"
</el-form-item> accept=".jpeg,.jpg,.gif,.png"
:show-file-list="false"
<el-form-item label="插图" prop="imgUrl"> :on-success="contentUploadSuccess"
<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-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true"> <quill-editor
<img width="100%" :src="dataForm.imgUrl" alt=""> v-model="dataForm.content"
</el-dialog> ref="myQuillEditor"
</el-form-item> :options="editorOption"
<el-form-item label="排序" prop="sort"> @blur="onEditorBlur($event)"
<el-input v-model="dataForm.sort" placeholder="排序"></el-input> @focus="onEditorFocus($event)"
</el-form-item> @ready="onEditorReady($event)"
<el-form-item label="内容" prop="content" class="custom-chapter-height"> class="chapter_editor"
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> --> style="height: 100%;"
<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> </quill-editor>
</el-form-item> </div>
<!-- <el-input v-model="dataForm.content" placeholder="内容"></el-input> -->
<!-- <el-form-item label="排序" prop="sort"> <!-- <el-button @click="handlereset">取消</el-button> -->
<el-input v-model="dataForm.sort" placeholder="排序"></el-input> <el-button type="primary" @click="dataFormSubmit()" style="float: right;"
</el-form-item> --> >保存</el-button
</el-form> >
<span slot="footer" class="dialog-footer"> </div>
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
import global from '../../common/common.vue' //引入共用组间 import global from "../../common/common.vue"; //引入共用组间
import { import { quillEditor } from "vue-quill-editor";
quillEditor import "quill/dist/quill.core.css";
} from 'vue-quill-editor' import "quill/dist/quill.snow.css";
import 'quill/dist/quill.core.css' import "quill/dist/quill.bubble.css";
import 'quill/dist/quill.snow.css' const toolbarOptions = [
import 'quill/dist/quill.bubble.css' ["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
const toolbarOptions = [ ["blockquote", "code-block"], //引用,代码块
['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线 [{ header: 1 }, { header: 2 }], // 几级标题
['blockquote', 'code-block'], //引用,代码块 [{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
[{ 'header': 1 }, { 'header': 2 }], // 几级标题 [{ script: "sub" }, { script: "super" }], // 下角标,上角标
[{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表 [{ indent: "-1" }, { indent: "+1" }], // 缩进
[{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标 [{ direction: "rtl" }], // 文字输入方向
[{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进 [{ size: ["small", false, "large", "huge"] }], // 字体大小
[{ 'direction': 'rtl' }], // 文字输入方向 [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小 [{ color: [] }, { background: [] }], // 颜色选择
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题 [
[{ 'color': [] }, { 'background': [] }], // 颜色选择 {
[{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体 font: [
[{ 'align': [] }], // 居中 "SimSun",
['clean'], // 清除样式, "SimHei",
['link', 'image'], // 上传图片、上传视频 "Microsoft-YaHei",
"KaiTi",
"FangSong",
"Arial"
] ]
export default { }
], // 字体
[{ align: [] }], // 居中
["clean"], // 清除样式,
["link", "image"] // 上传图片、上传视频
];
export default {
props: ["dataInfo", "type"],
data() { data() {
return { return {
baseUrl: global.baseUrl, baseUrl: global.baseUrl,
@@ -80,72 +79,65 @@
toolbar: { toolbar: {
container: toolbarOptions, container: toolbarOptions,
handlers: { handlers: {
image: function (value) { image: function(value) {
if (value) { if (value) {
// 调用element的图片上传组件 // 调用element的图片上传组件
document.querySelector('.chapter-avatar-uploader input').click() document
.querySelector(".chapter-avatar-uploader input")
.click();
} else { } else {
this.quill.format('image', false) this.quill.format("image", false);
}
} }
} }
} }
}, },
}, placeholder: "请输入" + this.dataInfo.label
placeholder: '请输入正文',
}, },
visible: false, visible: false,
props: { props: {
dictType: '', dictType: "",
dictValue: '' dictValue: ""
}, },
gushuList:[], gushuList: [],
authorList: [], authorList: [],
restaurants: [], restaurants: [],
author: '', author: "",
publisherList: [], publisherList: [],
fileList: [], fileList: [],
fileListNovel: [], fileListNovel: [],
dialogImageUrl: '', dialogImageUrl: "",
dialogVisible: false, dialogVisible: false,
dataForm: { dataForm: {
"courseId": 0,
"catalogueId": 0, content: "",
"title": "",
"imgUrl": "",
"content": "",
"sort": 1,
}, },
splitsTypeList: [], splitsTypeList: [],
dataRule: { dataRule: {}
};
}
}
}, },
components: { components: {
quillEditor quillEditor
}, },
created() { created() {},
}, mounted() {},
mounted() {
},
methods: { methods: {
contentUploadSuccess(res, file) { contentUploadSuccess(res, file) {
// console.log(res) // console.log(res)
let quill = this.$refs.myQuillEditor.quill let quill = this.$refs.myQuillEditor.quill;
// 如果上传成功 // 如果上传成功
if (res) { if (res) {
// 获取光标所在位置 // 获取光标所在位置
let length = quill.getSelection().index; let length = quill.getSelection().index;
// 插入图片res为服务器返回的图片链接地址 // 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', res.url) quill.insertEmbed(length, "image", res.url);
// 调整光标到最后 // 调整光标到最后
quill.setSelection(length + 1) quill.setSelection(length + 1);
} else { } else {
// 提示信息需引入Message // 提示信息需引入Message
this.$message.error('图片插入失败!') this.$message.error("图片插入失败!");
} }
}, },
// 失去焦点事件 // 失去焦点事件
onEditorBlur(quill) { onEditorBlur(quill) {
@@ -159,60 +151,39 @@
onEditorReady(quill) { onEditorReady(quill) {
// console.log('editor ready!', quill) // console.log('editor ready!', quill)
}, },
init(row, catalogue_id, courseid) { init(content) {
console.log('row21', row) console.log("row21", content);
this.dataForm =row? JSON.parse(JSON.stringify(row)): {} this.dataForm.content=content
this.dataForm.courseId = courseid?courseid : ''
this.dataForm.catalogueId = catalogue_id?catalogue_id : '' },
this.visible = true getContent(){
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 = []
}
}, },
// 表单提交 // 表单提交
dataFormSubmit() { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`${!this.dataForm.id ? '/master/course/addCourseCatalogueChapter' : '/master/course/editCourseCatalogueChapter'}`), url: this.$http.adornUrl("/master/course/editCourseRecord"),
method: 'post', method: "post",
data: this.$http.adornData({ data: this.$http.adornData({
"id": this.dataForm.id || undefined, type: this.type,
'courseId': this.dataForm.courseId || undefined, recordType: this.dataInfo.id, //0 buy_record , 1 use_record , 2 study_record, 3 vip_record
'catalogueId': this.dataForm.catalogueId || undefined, content: this.dataForm.content
'title': this.dataForm.title,
"imgUrl": this.dataForm.imgUrl,
"content": this.dataForm.content,
"sort": this.dataForm.sort,
}) })
}).then(({ }).then(({ data }) => {
data
}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: "操作成功",
type: 'success', type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false;
this.$emit('refreshDataList') this.$emit("refreshDataList");
} }
}) });
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg);
} }
}) });
}
})
}, },
handlePicSuccess(res, file) { handlePicSuccess(res, file) {
if (res.msg == "success") { if (res.msg == "success") {
@@ -223,35 +194,37 @@
} }
}, },
handleRemove(file) { handleRemove(file) {
this.dataForm.imgUrl = ''; this.dataForm.imgUrl = "";
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.dataForm.imgUrl = file.url; this.dataForm.imgUrl = file.url;
this.dialogVisible = true; this.dialogVisible = true;
}, },
handleDownload(file) { handleDownload(file) {
console.log(file) console.log(file);
}, },
handlereset() { handlereset() {
this.fileList = [], (this.fileList = []), (this.fileListNovel = []), (this.visible = false);
this.fileListNovel = [],
this.visible = false
}, },
handlePreview(file) { handlePreview(file) {
console.log(file); console.log(file);
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${
files.length
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
);
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemoveNovel(file) { handleRemoveNovel(file) {
this.dataForm.novel = ''; this.dataForm.novel = "";
}, },
handleNovelSuccess(file) { handleNovelSuccess(file) {
this.dataForm.novel = file.url this.dataForm.novel = file.url;
}, }
// querySearch(queryString, cb) { // querySearch(queryString, cb) {
// var restaurants = this.restaurants; // var restaurants = this.restaurants;
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; // var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
@@ -269,6 +242,5 @@
// console.log(item); // console.log(item);
// } // }
} }
};
}
</script> </script>

View File

@@ -1,127 +1,24 @@
<template> <template>
<div class="mod-config"> <div class="mod-config" style="height: calc(100vh - 180px)">
<el-form <el-tabs tab-position="left" style="height: 100%;" v-model="currentTab"@tab-click="handleClick">
:inline="true" <el-tab-pane
: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%;"
:label="v.label"
v-for="(v, i) in setList"
:key="i"
style="height: 100%;"
> >
<el-table-column
prop="title"
header-align="center"
align="center"
label="课程说明名称"
>
</el-table-column>
<!-- <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 <add-or-update
v-if="addOrUpdateVisible" :dataInfo="v"
ref="addOrUpdate" :type="type"
style="height: calc(100vh - 180px)"
:ref="`addOrUpdate${v.id}`"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></add-or-update>
</el-tab-pane>
</el-tabs>
<!-- 弹窗, 新增 / 修改 -->
</div> </div>
</template> </template>
@@ -130,6 +27,14 @@ import AddOrUpdate from "./chapter-add-or-update";
export default { export default {
data() { data() {
return { return {
currentTab: 0,
type: 0,
setList: [
{ label: "购买须知", id: 0 },
{ label: "使用须知", id: 1 },
{ label: "学习次序", id: 2 },
{ label: "超V用户", id: 3 }
],
dataForm: { dataForm: {
key: "" key: ""
}, },
@@ -164,30 +69,50 @@ export default {
this.getDataList(); this.getDataList();
}, },
methods: { methods: {
handleClick(tab, event) {
this.getDataList()
},
// 获取数据列表 // 获取数据列表
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.$http({ this.$http
url: this.$http.adornUrl( .request({
"/master/course/getCourseCatalogueChapterList" url: this.$http.adornUrl(`/master/course/getCourseRecord`),
), method: "POST",
method: "post", data: {
data: this.$http.adornData({ type: this.type
id: this.catalogue_id, },
page: this.pageIndex, header: {
limit: this.pageSize //默认 无 说明:请求头
// "type": this.query.type||0, //类型0全部1医学2国学 "Content-Type": "application/json"
// "categoryId": this.query.categoryId, //医学类型id当type为1时为必填项;为0时代表全部 }
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项为0代表全部
// "keywords": this.query.keywords //关键字
}) })
}).then(({ data }) => { .then(({ data }) => {
if (data && data.code === 0) { var that=this
this.dataList = data.page.records; console.log("data at line 86:", data);
this.totalPage = data.page.total; if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
} else { var content=''
this.dataList = []; switch (that.currentTab) {
this.totalPage = 0;
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; this.dataListLoading = false;
}); });
@@ -344,8 +269,11 @@ export default {
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp:1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
::v-deep .mod-config .el-tabs .el-tabs__content {
height: 100% !important;
}
</style> </style>

View File

@@ -1,127 +1,24 @@
<template> <template>
<div class="mod-config"> <div class="mod-config" style="height: calc(100vh - 180px)">
<el-form <el-tabs tab-position="left" style="height: 100%;" v-model="currentTab"@tab-click="handleClick">
:inline="true" <el-tab-pane
: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%;"
:label="v.label"
v-for="(v, i) in setList"
:key="i"
style="height: 100%;"
> >
<el-table-column
prop="title"
header-align="center"
align="center"
label="课程说明名称"
>
</el-table-column>
<!-- <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 <add-or-update
v-if="addOrUpdateVisible" :dataInfo="v"
ref="addOrUpdate" :type="type"
style="height: calc(100vh - 180px)"
:ref="`addOrUpdate${v.id}`"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></add-or-update>
</el-tab-pane>
</el-tabs>
<!-- 弹窗, 新增 / 修改 -->
</div> </div>
</template> </template>
@@ -130,6 +27,15 @@ import AddOrUpdate from "./chapter-add-or-update";
export default { export default {
data() { data() {
return { return {
content: '',
currentTab: 0,
type: 1,
setList: [
{ label: "购买须知", id: 0 },
{ label: "使用须知", id: 1 },
{ label: "学习次序", id: 2 },
{ label: "超V用户", id: 3 }
],
dataForm: { dataForm: {
key: "" key: ""
}, },
@@ -164,30 +70,52 @@ export default {
this.getDataList(); this.getDataList();
}, },
methods: { methods: {
handleClick(tab, event) {
this.getDataList()
},
// 获取数据列表 // 获取数据列表
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.$http({ this.$http
url: this.$http.adornUrl( .request({
"/master/course/getCourseCatalogueChapterList" url: this.$http.adornUrl(`/master/course/getCourseRecord`),
), method: "POST",
method: "post", data: {
data: this.$http.adornData({ type: this.type
id: this.catalogue_id, },
page: this.pageIndex, header: {
limit: this.pageSize //默认 无 说明:请求头
// "type": this.query.type||0, //类型0全部1医学2国学 "Content-Type": "application/json"
// "categoryId": this.query.categoryId, //医学类型id当type为1时为必填项;为0时代表全部 }
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项为0代表全部
// "keywords": this.query.keywords //关键字
}) })
}).then(({ data }) => { .then(({ data }) => {
if (data && data.code === 0) { var that=this
this.dataList = data.page.records; console.log("data at line 86:", data);
this.totalPage = data.page.total; if (data && data.code === 0) { console.log('that.currentTab at line 91:', that.currentTab)
} else { var content=''
this.dataList = []; switch (that.currentTab) {
this.totalPage = 0;
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; this.dataListLoading = false;
}); });
@@ -344,8 +272,11 @@ export default {
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp:1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
::v-deep .mod-config .el-tabs .el-tabs__content {
height: 100% !important;
}
</style> </style>

View File

@@ -40,7 +40,33 @@
import { import {
quillEditor quillEditor
} from 'vue-quill-editor' } 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.core.css'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css' import 'quill/dist/quill.bubble.css'
@@ -88,50 +114,10 @@
], ],
editorOption: { editorOption: {
modules: { modules: {
toolbar: [ toolbar: {
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线 container: toolbarOptions,
['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'] // 链接、图片、视频
]
}, },
placeholder: '请输入正文' placeholder: '请输入正文'
}, },

View File

@@ -9,7 +9,7 @@
// 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';
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';