Commit 559d2842 authored by zhengke's avatar zhengke

增加月刊

parent ee126d3f
......@@ -12,7 +12,7 @@ export default {
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_747pcje2wmh.css');
@import url('//at.alicdn.com/t/font_2077629_jhf9m689zd9.css');
html,
body,
......
......@@ -343,4 +343,102 @@ export function RemoveWebAdvisoryStatus(data) {
method: 'post',
data
})
}
/**
* 获取品牌卡通分页列表
*
*/
export function GetWebCartoonPage(data) {
return request({
url: '/WebManager/GetWebCartoonPage',
method: 'post',
data
})
}
/**
* 新增修改品牌动漫
*
*/
export function SetWebCartoon(data) {
return request({
url: '/WebManager/SetWebCartoon',
method: 'post',
data
})
}
/**
* 根据编号获取品牌卡通详情
*
*/
export function GetWebCartoon(data) {
return request({
url: '/WebManager/GetWebCartoon',
method: 'post',
data
})
}
/**
* 修改品牌卡通状态
*
*/
export function RemoveWebCartoonStatus(data) {
return request({
url: '/WebManager/RemoveWebCartoonStatus',
method: 'post',
data
})
}
/**
* 获取品牌月刊分页列表
*
*/
export function GetWebMonthlyPage(data) {
return request({
url: '/WebManager/GetWebMonthlyPage',
method: 'post',
data
})
}
/**
* 新增修改品牌月刊
*
*/
export function SetWebMonthly(data) {
return request({
url: '/WebManager/SetWebMonthly',
method: 'post',
data
})
}
/**
* 根据编号获取品牌月刊详情
*
*/
export function GetWebMonthly(data) {
return request({
url: '/WebManager/GetWebMonthly',
method: 'post',
data
})
}
/**
* 修改品牌月刊状态
*
*/
export function RemoveWebMonthlyStatus(data) {
return request({
url: '/WebManager/RemoveWebMonthlyStatus',
method: 'post',
data
})
}
\ No newline at end of file
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{optionTitle}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">漫画信息</div>
<div class="row wrap">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Name"
class="col-6 q-pr-lg q-pb-lg" label="漫画名称" />
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.LinkUrl"
class="col-6 q-pr-lg q-pb-lg" label="链接" />
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveComic" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
SetWebCartoon,
GetWebCartoon
} from '../../api/system/webkit'
export default {
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
Id: 0,
Name: '',
LinkUrl:''
},
optionTitle: "新增漫画",
saveLoading: false,
}
},
mounted() {
this.initObj()
},
methods: {
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.Id > 0) {
GetWebCartoon({
Id: this.saveObj.Id
}).then(res => {
if (res.Code == 1) {
this.objOption.Id = res.Data.Id;
this.objOption.Name = res.Data.Name;
this.objOption.LinkUrl = res.Data.LinkUrl;
this.optionTitle = '修改漫画'
}
})
}
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveComic() {
this.saveLoading = true
SetWebCartoon(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
}
},
}
</script>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{optionTitle}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">月刊信息</div>
<div class="row wrap" style="align-items:end;">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Name"
class="col-6 q-pr-lg q-pb-lg" label="月刊名称" />
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.LinkUrl"
class="col-6 q-pb-lg" label="链接" />
<div class="col-6 q-pb-lg q-pr-lg">
<q-uploader :style="{ backgroundImage: 'url(' + objOption.CoverImg + ')' }"
style="width:auto;height:200px;background-repeat:no-repeat;background-size:cover;" flat hide-upload-btn
max-files="1" label="封面" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveComic" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
SetWebMonthly,
GetWebMonthly
} from '../../api/system/webkit'
import {
UploadSelfFile
} from "../../api/common/common";
export default {
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
Id: 0,
Name: '',
LinkUrl: '',
CoverImg: '' //封面图
},
optionTitle: "新增月刊",
saveLoading: false,
}
},
mounted() {
this.initObj()
},
methods: {
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.Id > 0) {
GetWebMonthly({
Id: this.saveObj.Id
}).then(res => {
if (res.Code == 1) {
this.objOption.Id = res.Data.Id;
this.objOption.Name = res.Data.Name;
this.objOption.CoverImg = res.Data.CoverImg;
this.objOption.LinkUrl = res.Data.LinkUrl;
this.optionTitle = '修改月刊'
}
})
}
},
uploadFile(files) {
UploadSelfFile("course", files[0], res => {
if (res.Code == 1) {
this.objOption.CoverImg = res.FileUrl;
}
});
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveComic() {
this.saveLoading = true
SetWebMonthly(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
}
},
}
</script>
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @change="resetSearch" clearable standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="msg.Name" label="漫画名称" maxlength="20" @clear="resetSearch" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="msg.Status" :options="ShowOpts" emit-value map-options label="状态" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">漫画信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" class="q-mr-md" size="sm" icon="add" label="新增教师" @click="EditComic(null)" />
</div>
</template>
<template v-slot:body-cell-DealStatusStr="props">
<q-td>
<span v-if="props.row.DealStatus==1" style="color:rgb(103, 194, 58)">{{props.row.DealStatusStr}}</span>
<span v-if="props.row.DealStatus==0" style="color:rgb(233, 82, 82)">{{props.row.DealStatusStr}}</span>
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400"
label="编辑" @click="EditComic(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除"
@click="delComic(props.row)" />
</q-td>
</template>
</q-table>
<comic-form v-if="isShowComicForm" :save-obj="comicObjOption" @close="closeComicForm" @success="refreshPage">
</comic-form>
</div>
</div>
</template>
<script>
import {
GetWebCartoonPage,
RemoveWebCartoonStatus
} from '../../api/system/webkit'
import comicForm from '../../components/system/comic-form'
export default {
meta: {
title: "漫画管理"
},
components: {
comicForm
},
data() {
return {
columns: [{
name: 'Name',
label: '漫画名称',
field: 'Name',
align: 'left'
}, {
name: 'LinkUrl',
label: '链接',
field: 'LinkUrl',
align: 'left'
}, {
name: 'optioned',
label: '操作',
field: 'MenuId'
}],
data: [],
loading: true,
ShowOpts: [{
label: '全部',
value: -1
},
{
label: '正常',
value: 0
},
{
label: '删除',
value: 1
}
],
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
Name: '',
Status: -1
},
pageCount: 0,
isShowComicForm: false,
comicObjOption: null,
}
},
mounted() {
this.getList()
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
//获取菜单分页列表
getList() {
this.loading = true;
GetWebCartoonPage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}).catch(() => {
this.loading = false
})
},
//刷新页面
refreshPage() {
if (!this.comicObjOption) {
this.msg.pageIndex = 1;
this.msg.Name = "";
this.msg.Status = -1;
}
this.getList()
},
//新增修改菜单
EditComic(obj) {
if (obj) {
this.comicObjOption = obj
} else {
this.comicObjOption = null
}
this.isShowComicForm = true
},
//关闭弹窗
closeComicForm() {
this.isShowComicForm = false
},
//删除
delComic(obj) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
let delMsg = {
Id: obj.Id,
Status: 1
}
RemoveWebCartoonStatus(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.getList();
}
})
})
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @change="resetSearch" clearable standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="msg.Name" label="月刊名称" maxlength="20" @clear="resetSearch" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" class="col-6 q-pr-lg q-pr-lg"
v-model="msg.Status" :options="ShowOpts" emit-value map-options label="状态" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">月刊信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" class="q-mr-md" size="sm" icon="add" label="新增月刊" @click="EditComic(null)" />
</div>
</template>
<template v-slot:body-cell-CoverImg="props">
<q-td>
<img :src="props.row.CoverImg" style="width:50px;" />
</q-td>
</template>
<template v-slot:body-cell-DealStatusStr="props">
<q-td>
<span v-if="props.row.DealStatus==1" style="color:rgb(103, 194, 58)">{{props.row.DealStatusStr}}</span>
<span v-if="props.row.DealStatus==0" style="color:rgb(233, 82, 82)">{{props.row.DealStatusStr}}</span>
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditComic(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除"
@click="delMonthly(props.row)" />
</q-td>
</template>
</q-table>
<monthly-form v-if="isShowMonthForm" :save-obj="monthObjOption" @close="closeMonthForm" @success="refreshPage">
</monthly-form>
</div>
</div>
</template>
<script>
import {
GetWebMonthlyPage,
RemoveWebMonthlyStatus
} from '../../api/system/webkit'
import monthlyForm from '../../components/system/monthly-form'
export default {
meta: {
title: "月刊管理"
},
components: {
monthlyForm
},
data() {
return {
columns: [{
name: 'Name',
label: '月刊名称',
field: 'Name',
align: 'left'
}, {
name: 'LinkUrl',
label: '链接',
field: 'LinkUrl',
align: 'left'
}, {
name: 'CoverImg',
label: '月刊封面',
field: 'CoverImg',
align: 'left'
}, {
name: 'optioned',
label: '操作',
field: 'MenuId'
}],
data: [],
loading: true,
ShowOpts: [{
label: '全部',
value: -1
},
{
label: '正常',
value: 0
},
{
label: '删除',
value: 1
}
],
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
Name: '',
Status: -1
},
pageCount: 0,
isShowMonthForm: false,
monthObjOption: null,
}
},
mounted() {
this.getList()
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getList()
},
//获取菜单分页列表
getList() {
this.loading = true;
GetWebMonthlyPage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}).catch(() => {
this.loading = false
})
},
//刷新页面
refreshPage() {
if (!this.monthObjOption) {
this.msg.pageIndex = 1;
this.msg.Name = "";
this.msg.Status = -1;
}
this.getList()
},
//新增修改菜单
EditComic(obj) {
if (obj) {
this.monthObjOption = obj
} else {
this.monthObjOption = null
}
this.isShowMonthForm = true
},
//关闭弹窗
closeMonthForm() {
this.isShowMonthForm = false
},
//删除
delMonthly(obj) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
let delMsg = {
Id: obj.Id,
Status: 1
}
RemoveWebMonthlyStatus(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.getList();
}
})
})
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -127,6 +127,16 @@ const routes = [{
component: () =>
import("pages/system/consultManage.vue")
},
{
path: "/system/comicManage", //品牌漫画管理
component: () =>
import("pages/system/comicManage.vue")
},
{
path: "/system/monthlyManage", //品牌月刊管理
component: () =>
import("pages/system/monthlyManage.vue")
},
{
path: "/course/catagory", //课程分类
component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment