曲靖
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="AppMarketingActivity">
|
||||
<keep-alive :include="['List']">
|
||||
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Detail from './components/Detail'
|
||||
import List from './components/List'
|
||||
import Add from './components/Add'
|
||||
|
||||
export default {
|
||||
name: 'AppCurriculumManage',
|
||||
label: '课程管理',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
component: 'List',
|
||||
params: {},
|
||||
include: []
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
Add,
|
||||
List,
|
||||
Detail
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange (data) {
|
||||
if (data.type === 'Add') {
|
||||
this.component = 'Add'
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === 'Detail') {
|
||||
this.component = 'Detail'
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === 'List') {
|
||||
this.component = 'List'
|
||||
this.params = data.params
|
||||
|
||||
this.$nextTick(() => {
|
||||
if (data.isRefresh) {
|
||||
this.$refs.component.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.AppMarketingActivity {
|
||||
height: 100%;
|
||||
background: #F3F6F9;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
273
project/qujing/app/AppCurriculumManage/components/Add.vue
Normal file
273
project/qujing/app/AppCurriculumManage/components/Add.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<ai-detail class="content-add">
|
||||
<template slot="title">
|
||||
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<el-form class="ai-form" :model="form" label-width="180px!important" ref="form">
|
||||
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]">
|
||||
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="beginTime" label="开始时间" :rules="[{required: true, message: '请选择开始时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.beginTime"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="endTime" label="结束时间" :rules="[{required: true, message: '请选择结束时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round1ActiveLimit" label="第一轮抽奖限制日活天数">
|
||||
<el-input-number size="small" v-model="form.round1ActiveLimit" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round2ActiveLimit" label="第二轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round2ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round3ActiveLimit" label="第三轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round3ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round4ActiveLimit" label="第四轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round4ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="beginTime5" label="第五轮抽奖开始时间" :rules="[{required: true, message: '第五轮抽奖开始时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.beginTime5"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="第五轮抽奖开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round5ActiveLimit" label="第五轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round5ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%;" prop="wxQrcode" label="微信插件二维码" :rules="[{required: true, message: '请上传', trigger: 'change'}]">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
v-model="form.wxQrcode"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-form-item :label="'奖品' + (index + 1)" style="width: 100%;" v-for="(item, index) in form.prizes" :key="'prizes' + (index + 1)">
|
||||
<div>
|
||||
<div class="form-flex">
|
||||
<div class="prize-item">
|
||||
<span>奖品名称:</span>
|
||||
<el-input size="small" style="width: 265px;" placeholder="请输入奖品名称" v-model="item.name"></el-input>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>中奖规则:</span>
|
||||
<el-input size="small" style="width: 265px;" placeholder="指定第x个抽奖的人中奖,多个逗号隔开" v-model="item.rule"></el-input>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品总数:</span>
|
||||
<el-input-number size="small" v-model="item.total" :min="1"></el-input-number>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品排序:</span>
|
||||
<el-input-number size="small" v-model="item.showIndex" :min="1"></el-input-number>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>开放轮次:</span>
|
||||
<el-radio-group v-model="item.belongRound">
|
||||
<el-radio :label="1">第一轮</el-radio>
|
||||
<el-radio :label="2">第二轮</el-radio>
|
||||
<el-radio :label="3">第三轮</el-radio>
|
||||
<el-radio :label="4">第四轮</el-radio>
|
||||
<el-radio :label="5">第五轮</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>是否默认:</span>
|
||||
<el-switch
|
||||
v-model="item.defaultPrize"
|
||||
active-value="1"
|
||||
inactive-value="0">
|
||||
</el-switch>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品图片:</span>
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
v-model="item.picture"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<el-button type="danger" @click="remove(index)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item style="width: 100%;">
|
||||
<el-button type="primary" @click="add">添加奖品</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="confirm">提交</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'Add',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
form: {
|
||||
title: '',
|
||||
beginTime: '',
|
||||
beginTime1: '',
|
||||
beginTime2: '',
|
||||
beginTime3: '',
|
||||
beginTime4: '',
|
||||
beginTime5: '',
|
||||
endTime: '',
|
||||
round1ActiveLimit: '',
|
||||
round2ActiveLimit: '',
|
||||
round3ActiveLimit: '',
|
||||
round4ActiveLimit: '',
|
||||
round5ActiveLimit: '',
|
||||
wxQrcode: [],
|
||||
prizes: []
|
||||
},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
created () {
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
|
||||
this.form.wxQrcode = [{
|
||||
url: res.data.wxQrcode
|
||||
}]
|
||||
if (res.data.prizes.length) {
|
||||
this.form.prizes = res.data.prizes.map(v => {
|
||||
return {
|
||||
...v,
|
||||
picture: [{
|
||||
url: v.picture
|
||||
}]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
add () {
|
||||
this.form.prizes.push({
|
||||
name: '',
|
||||
picture: [],
|
||||
rule: '',
|
||||
showIndex: '',
|
||||
total: '',
|
||||
defaultPrize: '',
|
||||
belongRound: ''
|
||||
})
|
||||
},
|
||||
|
||||
remove (index) {
|
||||
this.form.prizes.splice(index, 1)
|
||||
},
|
||||
|
||||
confirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: this.params.id || '',
|
||||
wxQrcode: this.form.wxQrcode[0].url,
|
||||
prizes: this.form.prizes.map(v => {
|
||||
return {
|
||||
...v,
|
||||
picture: v.picture[0].url
|
||||
}
|
||||
})
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功')
|
||||
setTimeout(() => {
|
||||
this.cancel(true)
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.prize-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14px;
|
||||
width: 50%;
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
270
project/qujing/app/AppCurriculumManage/components/Detail.vue
Normal file
270
project/qujing/app/AppCurriculumManage/components/Detail.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<ai-detail isHasSidebar class="AppMarketingActivity-detail">
|
||||
<template slot="title">
|
||||
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar>
|
||||
<div v-show="currIndex === 0">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
label-width="180px">
|
||||
<ai-info-item label="活动标题" isLine :value="info.title"></ai-info-item>
|
||||
<ai-info-item label="开始时间" :value="info.beginTime"></ai-info-item>
|
||||
<ai-info-item label="结束时间" :value="info.endTime"></ai-info-item>
|
||||
<ai-info-item label="第一轮抽奖限制日活天数" :value="info.round1ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第二轮抽奖限制日活天数" :value="info.round2ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第三轮抽奖限制日活天数" :value="info.round3ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第四轮抽奖限制日活天数" :value="info.round4ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第五轮抽奖开始时间" :value="info.beginTime5"></ai-info-item>
|
||||
<ai-info-item label="第五轮抽奖限制日活天数" :value="info.round5ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="微信插件二维码">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
:value="[{
|
||||
url: info.wxQrcode
|
||||
}]"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="奖品">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
class="prize-item"
|
||||
v-for="(item, key) in info.prizes"
|
||||
:key="key"
|
||||
label-width="180px">
|
||||
<ai-info-item label="奖品名称" isLine :value="item.name"></ai-info-item>
|
||||
<ai-info-item label="中奖规则" :value="item.rule"></ai-info-item>
|
||||
<ai-info-item label="奖品总数" :value="item.total"></ai-info-item>
|
||||
<ai-info-item label="奖品排序" :value="item.showIndex"></ai-info-item>
|
||||
<ai-info-item label="开放轮次" :value="item.belongRound"></ai-info-item>
|
||||
<ai-info-item label="是否默认" :value="item.defaultPrize === '0' ? '否' : '是'"></ai-info-item>
|
||||
<ai-info-item label="奖品图片" isLine>
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
:value="[{
|
||||
url: item.picture
|
||||
}]"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
<div v-show="currIndex === 1">
|
||||
<ai-card title="报名记录">
|
||||
<template #content>
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appmarketingactivityinfo/exportSignUpList"
|
||||
:params="{
|
||||
...search,
|
||||
activityId: params.id
|
||||
}"
|
||||
fileName="报名记录"
|
||||
:disabled="!tableData.length">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.name"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@clear="search.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
<div v-show="currIndex === 2">
|
||||
<ai-card title="抽奖记录">
|
||||
<template #content>
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-select
|
||||
v-model="prizeSearch.prizeId"
|
||||
clearable
|
||||
placeholder="请选择奖品"
|
||||
:selectList="prizes"
|
||||
@change="prizeSearch.current = 1, getPrizeList()">
|
||||
</ai-select>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appmarketingactivityinfo/exportTaffleList"
|
||||
:params="{
|
||||
...prizeSearch,
|
||||
activityId: params.id
|
||||
}"
|
||||
fileName="抽奖记录"
|
||||
:disabled="!tableData.length">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="prizeSearch.name"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {prizeSearch.current = 1, getPrizeList()}"
|
||||
placeholder="请输入奖品名称"
|
||||
clearable
|
||||
@clear="prizeSearch.current = 1, getPrizeList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="prizeList"
|
||||
:col-configs="prizeColConfigs"
|
||||
:total="prizeSearch.total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="prizeSearch.current"
|
||||
:size.sync="prizeSearch.size"
|
||||
@getList="getPrizeList">
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Detail',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
currIndex: 0,
|
||||
tabList: ['基本信息', '报名记录', '抽奖记录'],
|
||||
colConfigs: [
|
||||
{ prop: 'name', label: '姓名', align: 'left', width: '200px' },
|
||||
{ prop: 'phone', label: '手机号', align: 'center' },
|
||||
{ prop: 'createTime', label: '报名时间', align: 'center' }
|
||||
],
|
||||
prizeColConfigs: [
|
||||
{ prop: 'name', label: '姓名', align: 'left', width: '200px' },
|
||||
{ prop: 'phone', label: '手机号', align: 'center' },
|
||||
{ prop: 'prizeName', label: '奖品名称', align: 'center' },
|
||||
{ prop: 'createTime', label: '抽奖时间', align: 'center' }
|
||||
],
|
||||
prizeList: [],
|
||||
prizeSearch: {
|
||||
size: 10,
|
||||
current: 1,
|
||||
name: '',
|
||||
prizeId: ''
|
||||
},
|
||||
search: {
|
||||
size: 10,
|
||||
name: '',
|
||||
current: 1
|
||||
},
|
||||
prizes: [],
|
||||
tableData: [],
|
||||
total: 0,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
this.getPrizeList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/signUpList?activityId=${this.params.id}`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getPrizeList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/raffleList?activityId=${this.params.id}`, null, {
|
||||
params: {
|
||||
...this.prizeSearch
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.prizeList = res.data.records
|
||||
this.prizeSearch.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/queryDetailById?id=${this.params.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.info = res.data
|
||||
this.prizes = res.data.prizes.map(v => {
|
||||
return {
|
||||
dictValue: v.id,
|
||||
dictName: v.name
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel () {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppMarketingActivity-detail {
|
||||
.prize-item {
|
||||
padding: 20px 0 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
&:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
148
project/qujing/app/AppCurriculumManage/components/List.vue
Normal file
148
project/qujing/app/AppCurriculumManage/components/List.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<ai-list class="notice">
|
||||
<template slot="title">
|
||||
<ai-title title="课程管理" isShowBottomBorder>
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
clearable
|
||||
placeholder="请选择活动状态"
|
||||
:selectList="statusList"
|
||||
@change="search.current = 1, getList()">
|
||||
</ai-select>
|
||||
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.title"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入活动标题"
|
||||
clearable
|
||||
@clear="search.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||
<!-- <el-button type="text" @click="remove(row.id)">删除</el-button> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'List',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
title: '',
|
||||
status: ''
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '活动标题', align: 'left' },
|
||||
{ prop: 'createUserName', label: '创建人', align: 'center' },
|
||||
{ prop: 'beginTime', label: '开始时间', align: 'center' },
|
||||
{ prop: 'endTime', label: '结束时间', align: 'center' },
|
||||
{ prop: 'createTime', label: '创建时间', align: 'center' }
|
||||
],
|
||||
tableData: [],
|
||||
statusList: [
|
||||
{
|
||||
dictValue: '0',
|
||||
dictName: '未开始'
|
||||
},
|
||||
{
|
||||
dictValue: '1',
|
||||
dictName: '进行中'
|
||||
},
|
||||
{
|
||||
dictValue: '2',
|
||||
dictName: '已结束'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
remove (id) {
|
||||
this.$confirm('确定删除该活动?').then(() => {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
toDetail (id) {
|
||||
this.$emit('change', {
|
||||
type: 'Detail',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
134
project/qujing/app/AppPressCenter/AppPressCenter.vue
Normal file
134
project/qujing/app/AppPressCenter/AppPressCenter.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div class="appPressCenter">
|
||||
<ai-list v-show="showList">
|
||||
<template slot="title">
|
||||
<ai-title
|
||||
title="新闻中心"
|
||||
:isShowBottomBorder="false"
|
||||
@change="changeAreaId"
|
||||
:isShowArea="true"
|
||||
:instance="instance"
|
||||
v-model="areaId"
|
||||
:hideLevel="hideLevel"/>
|
||||
</template>
|
||||
<template slot="tabs">
|
||||
<el-tabs v-model="currIndex">
|
||||
<el-tab-pane
|
||||
v-for="(tab, i) in tabs"
|
||||
:key="i"
|
||||
:label="tab.label"
|
||||
:name="String(i)"
|
||||
>
|
||||
<component
|
||||
:is="tab.comp"
|
||||
v-if="currIndex === String(i)"
|
||||
:ref="currIndex"
|
||||
:instance="instance"
|
||||
:dict="dict"
|
||||
:permissions="permissions"
|
||||
:areaId="areaId"
|
||||
@goPage="goPage"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</ai-list>
|
||||
|
||||
<component
|
||||
v-if="!showList"
|
||||
:is="currentPage"
|
||||
:detail="detail"
|
||||
:instance="instance"
|
||||
:dict="dict"
|
||||
:permissions="permissions"
|
||||
:areaId="areaId"
|
||||
@goBack="goBack"
|
||||
@goPage="goPage"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {addArticle, addVideo, commentList, newsDetail, newsList, videoDetail} from './components'
|
||||
|
||||
export default {
|
||||
name: 'AppPressCenter',
|
||||
label: '新闻中心',
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
components: {
|
||||
newsList,
|
||||
commentList,
|
||||
addVideo,
|
||||
addArticle,
|
||||
newsDetail,
|
||||
videoDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
areaId: '',
|
||||
currIndex: '0',
|
||||
detail: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
tabs() {
|
||||
return [
|
||||
{
|
||||
label: '内容管理',
|
||||
name: 'newsList',
|
||||
comp: newsList,
|
||||
addVideo: addVideo,
|
||||
addArticle: addArticle,
|
||||
newsDetail: newsDetail,
|
||||
videoDetail: videoDetail
|
||||
},
|
||||
{label: '评论管理', name: 'commentList', comp: commentList}
|
||||
]
|
||||
},
|
||||
showList() {
|
||||
return !this.$route.hash
|
||||
},
|
||||
hideLevel() {
|
||||
return this.user.info.areaList?.length - 1
|
||||
},
|
||||
currentPage() {
|
||||
return this.$route.hash?.substring(1)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeAreaId() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[this.currIndex][0].getList()
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
this.$router.push({})
|
||||
},
|
||||
goPage(obj) {
|
||||
let hash = "#" + obj.key
|
||||
if (obj.row) {
|
||||
let {id} = obj.row
|
||||
this.$router.push({query: {id}, hash})
|
||||
} else {
|
||||
this.$router.push({hash})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.areaId = this.user.info.areaId
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.appPressCenter {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
154
project/qujing/app/AppPressCenter/components/addArticle.vue
Normal file
154
project/qujing/app/AppPressCenter/components/addArticle.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<ai-detail class="add-article">
|
||||
<template slot="title">
|
||||
<ai-title :title="isEdit?'编辑文章':'发布文章'" :isShowBack="true" :isShowBottomBorder="true"
|
||||
@onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="发布文章">
|
||||
<template #content>
|
||||
<el-form ref="ruleForm" :model="articInfo" :rules="rules" label-width="120px" label-position="right">
|
||||
<el-form-item prop="title" label="标题:">
|
||||
<el-input v-model="articInfo.title" size="small" placeholder="请输入…" maxlength="30"
|
||||
show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="policyType" label="类型:">
|
||||
<ai-select
|
||||
v-model="articInfo.policyType"
|
||||
placeholder="选择新闻类型"
|
||||
:selectList="dict.getDict('newsCenterPolicyType')">
|
||||
</ai-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布地区:" prop="areaId">
|
||||
<ai-area-get v-model="articInfo.areaId" :instance="instance" :root="areaId"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="content" label="正文:">
|
||||
<ai-editor v-model="articInfo.content" :instance="instance"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="coverFile" label="封面:">
|
||||
<ai-uploader :instance="instance" v-model="articInfo.coverFile" :limit="1" :isShowTip="true"
|
||||
@change="$refs['ruleForm'].clearValidate('coverFile')" :cropOps="cropOps" is-crop>
|
||||
<template slot="tips">最多上传1张图片,单个文件最大10MB,支持jpg、jpeg、png<br/>格式图片比例:1.6:1</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer">
|
||||
<el-button class="footer_btn" @click="$emit('goBack')">取消</el-button>
|
||||
<el-button type="primary" class="footer_btn" @click="handleSubmit('1')" v-if="!isEdit">发布</el-button>
|
||||
<el-button class="footer_btn" @click="handleSubmit('0')">保存</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "addArticle",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
detail: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
articInfo: {
|
||||
areaId: '',
|
||||
title: "",
|
||||
content: "",
|
||||
policyType: '',
|
||||
coverFile: [],
|
||||
},
|
||||
rules: {
|
||||
title: {required: true, message: '请输入标题', trigger: 'blur'},
|
||||
areaId: {required: true, message: '请选择 发布地区', trigger: 'blur'},
|
||||
policyType: {required: true, message: '请选择类型', trigger: 'change'},
|
||||
content: {required: true, message: '请填写内容', trigger: 'blur'},
|
||||
coverFile: {required: true, message: '请上传封面', trigger: 'blur'},
|
||||
},
|
||||
cropOps: {
|
||||
fixedNumber: [1.8, 1],
|
||||
fixed: true
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isEdit() {
|
||||
return !!this.$route.query.id;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 发布、保存新闻
|
||||
* @param status
|
||||
*/
|
||||
handleSubmit(status) {
|
||||
this.$refs["ruleForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.addOrUpdate(status);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 新增、修改
|
||||
* */
|
||||
addOrUpdate(status) {
|
||||
const msg = +status ? '发布成功' : this.isEdit ? '编辑成功' : '保存成功';
|
||||
this.instance.post(`/app/appnewscenterinfo/addOrUpdate`, {
|
||||
...this.articInfo,
|
||||
coverFile: {
|
||||
id: this.articInfo.coverFile[0].id
|
||||
},
|
||||
type: 0,
|
||||
id: this.$route.query.id,
|
||||
status: status
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(msg);
|
||||
this.$emit("goBack");
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据id查询详情
|
||||
*/
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
id && this.instance.post(`/app/appnewscenterinfo/queryDetailById`, null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.articInfo = res.data
|
||||
this.articInfo.areaId = res.data.areaId
|
||||
this.articInfo.title = res.data.title;
|
||||
this.articInfo.content = res.data.content;
|
||||
this.articInfo.policyType = res.data.policyType
|
||||
this.articInfo.coverFile = [{...res.data.coverFile, url: res.data.coverFile.accessUrl}];
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add-article {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #F3F6F9;
|
||||
|
||||
.footer_btn {
|
||||
width: 106px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
262
project/qujing/app/AppPressCenter/components/addVideo.vue
Normal file
262
project/qujing/app/AppPressCenter/components/addVideo.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<ai-detail class="add-video">
|
||||
<template slot="title">
|
||||
<ai-title :title="isEdit?'编辑视频':'发布视频'" :isShowBack="true" :isShowBottomBorder="true"
|
||||
@onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="发布视频">
|
||||
<template #content>
|
||||
<el-form ref="ruleForm" :model="newsInfo" :rules="rules" label-width="120px" label-position="right">
|
||||
<el-form-item prop="title" label="标题:">
|
||||
<el-input v-model="newsInfo.title" size="small" placeholder="请输入…" maxlength="30"
|
||||
show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="policyType" label="类型:">
|
||||
<ai-select
|
||||
v-model="newsInfo.policyType"
|
||||
placeholder="选择新闻类型"
|
||||
:selectList="$dict.getDict('newsCenterPolicyType')">
|
||||
</ai-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布地区:" prop="areaId">
|
||||
<ai-area-get v-model="newsInfo.areaId" :instance="instance" :root="areaId"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="videoFile" label="视频:">
|
||||
<el-upload :show-file-list="false" ref="upload1"
|
||||
action :http-request="submitUpload" :accept="accept" :limit="1">
|
||||
<div class="video" v-if="!newsInfo.videoFile.length">
|
||||
<div class="icon">
|
||||
<ai-icon type="svg" icon="iconVideo"/>
|
||||
<span>上传视频</span>
|
||||
</div>
|
||||
<span class="tips">支持mp4格式,单个文件最大100MB</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<video class="video-com" style="width:100%; height:100%; object-fit: fill;" muted
|
||||
:src="newsInfo.videoFile[0].url" controls="controls" v-if="newsInfo.videoFile.length"></video>
|
||||
<el-upload :show-file-list="false" ref="upload2" action :http-request="submitUpload" :accept="accept"
|
||||
:limit="1" v-if="newsInfo.videoFile.length">
|
||||
<el-button style="margin-top: 10px;">重新选择</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item prop="coverFile" label="封面:">
|
||||
<ai-uploader :instance="instance" v-model="newsInfo.coverFile" :limit="1"
|
||||
@change="$refs['ruleForm'].clearValidate('coverFile')" :cropOps="cropOps" is-crop>
|
||||
<template slot="tips">图片比例:1.8:1</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer">
|
||||
<el-button class="footer_btn" @click="$emit('goBack')">取消</el-button>
|
||||
<el-button type="primary" class="footer_btn" @click="handleSubmit('1')" v-if="!isEdit">发布</el-button>
|
||||
<el-button class="footer_btn" @click="handleSubmit('0')">保存</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mp4box from 'mp4box'
|
||||
|
||||
export default {
|
||||
name: "addVideo",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
detail: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
newsInfo: {
|
||||
areaId: '',
|
||||
title: "",
|
||||
policyType: '',
|
||||
videoFile: [],
|
||||
coverFile: []
|
||||
},
|
||||
accept: ".mp4",
|
||||
rules: {
|
||||
title: {required: true, message: '请输入标题', trigger: 'blur'},
|
||||
areaId: {required: true, message: '请选择 发布地区', trigger: 'blur'},
|
||||
policyType: {required: true, message: '请选择类型', trigger: 'change'},
|
||||
videoFile: {required: true, message: '请上传视频', trigger: 'blur'},
|
||||
coverFile: {required: true, message: '请上传封面', trigger: 'blur'},
|
||||
},
|
||||
cropOps: {
|
||||
width: "320px",
|
||||
height: "180px"
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isEdit() {
|
||||
return !!this.$route.query.id;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSubmit(status) {
|
||||
this.$refs["ruleForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.addOrUpdate(status);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上传视频
|
||||
*/
|
||||
submitUpload(file) {
|
||||
this.$refs['upload1']?.clearFiles();
|
||||
this.$refs['upload2']?.clearFiles();
|
||||
this.$refs['ruleForm']?.clearValidate('videoFile');
|
||||
const fileType = file.file.name.split(".")[1];
|
||||
const size = file.file.size / 1024 / 1024 > 100;
|
||||
let mp4boxfile = mp4box.createFile();
|
||||
const reader = new FileReader();
|
||||
reader.readAsArrayBuffer(file.file);
|
||||
reader.onload = (e) => {
|
||||
const arrayBuffer = e.target.result;
|
||||
arrayBuffer.fileStart = 0;
|
||||
mp4boxfile.appendBuffer(arrayBuffer);
|
||||
};
|
||||
mp4boxfile.onReady = (info) => {
|
||||
let codec = info.mime.match(/codecs="(\S*),/)[1]
|
||||
if (codec.indexOf('avc') === -1) {
|
||||
return this.$message.error("视频编码格式不支持")
|
||||
}
|
||||
|
||||
if (size) {
|
||||
return this.$message.error("视频大小不能超过100M");
|
||||
}
|
||||
|
||||
if (fileType && this.accept.indexOf(fileType.toLocaleLowerCase()) > -1) {
|
||||
let formData = new FormData()
|
||||
formData.append('file', file.file);
|
||||
this.instance.post(`/admin/file/add-unlimited`, formData).then(res => {
|
||||
if (res && res.data) {
|
||||
let videoList = res.data[0].split(";");
|
||||
this.newsInfo.videoFile.splice(0, 1, {
|
||||
id: videoList[1],
|
||||
url: videoList[0]
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return this.$message.error("视频格式错误");
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
addOrUpdate(status) {
|
||||
const msg = +status ? '发布成功' : this.isEdit ? '编辑成功' : '保存成功';
|
||||
this.instance.post(`/app/appnewscenterinfo/addOrUpdate`, {
|
||||
title: this.newsInfo.title,
|
||||
videoFile: {
|
||||
id: this.newsInfo.videoFile[0].id
|
||||
},
|
||||
coverFile: {
|
||||
id: this.newsInfo.coverFile[0].id
|
||||
},
|
||||
policyType: this.newsInfo.policyType,
|
||||
areaId: this.areaId,
|
||||
type: 1,
|
||||
id: this.detail.id,
|
||||
status: this.isEdit ? this.detail.status : status
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(msg);
|
||||
this.$emit("goBack");
|
||||
}
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
this.instance.post(`/app/appnewscenterinfo/queryDetailById`, null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.newsInfo.areaId = res.data.areaId
|
||||
this.newsInfo.title = res.data.title;
|
||||
this.newsInfo.policyType = res.data.policyType
|
||||
this.newsInfo.videoFile = [{...res.data.videoFile, url: res.data.videoFile.accessUrl}];
|
||||
this.newsInfo.coverFile = [{...res.data.coverFile, url: res.data.coverFile.accessUrl}];
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add-video {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
.video {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
border-radius: 4px;
|
||||
border: 1px dashed #D0D4DC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
span:nth-child(2) {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
font-size: 40px;
|
||||
color: #2266FF;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
line-height: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.video-com {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
margin-top: -40px;
|
||||
}
|
||||
|
||||
:deep( .AiIcon ){
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.footer_btn {
|
||||
width: 106px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
123
project/qujing/app/AppPressCenter/components/commentList.vue
Normal file
123
project/qujing/app/AppPressCenter/components/commentList.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<ai-list class="comment-list" isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.title"
|
||||
size="small"
|
||||
placeholder="搜索内容/用户"
|
||||
clearable
|
||||
v-throttle="() => {page.current = 1, getList()}"
|
||||
@clear="page.current = 1, searchObj.title = '', getList()"
|
||||
suffix-icon="iconfont iconSearch" />
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
stripe
|
||||
:total="total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
style="margin-top: 10px;"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" label="操作" fixed="right" width="120" align="center" >
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" title="删除" :disabled="!permissions('app_appnewscentercomment_del')" @click="handleDelete(row)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "dayjs"
|
||||
export default {
|
||||
name: "commentList",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId:String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData:[],
|
||||
total:0,
|
||||
isClick: false,
|
||||
page:{
|
||||
current:1,
|
||||
size:10
|
||||
},
|
||||
searchObj:{
|
||||
title:'',
|
||||
},
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
colConfigs () {
|
||||
return [
|
||||
{prop: 'title', label: '评论对象',align:'left', width:180},
|
||||
{prop: 'content', label: '评论内容',width:280},
|
||||
{prop: 'name', label: '用户',align: "center"},
|
||||
{prop: 'commentTime', label: '评论时间'},
|
||||
{slot: 'options', label: '操作'}
|
||||
]
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
resetSearch() {
|
||||
this.searchObj.title = "";
|
||||
this.getList();
|
||||
},
|
||||
handleDelete({id}){
|
||||
this.$confirm("是否删除?").then(()=>this.deleteComment(id));
|
||||
},
|
||||
/**
|
||||
* 删除评论
|
||||
*/
|
||||
deleteComment(id){
|
||||
this.instance.post(`/app/appnewscentercomment/delete?id=${id}`).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$message.success("删除成功");
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.instance.post(`/app/appnewscentercomment/list`, null, {
|
||||
params: {
|
||||
...this.page,
|
||||
...this.searchObj,
|
||||
areaId: this.areaId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res && res.data) {
|
||||
this.tableData = res.data.records.map(e=>{
|
||||
return{
|
||||
...e,
|
||||
commentTime:moment(e.commentTime).format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
});
|
||||
this.total = res.data.total;
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.comment-list{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
}
|
||||
</style>
|
||||
6
project/qujing/app/AppPressCenter/components/index.js
Normal file
6
project/qujing/app/AppPressCenter/components/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export {default as newsList} from "./newsList";
|
||||
export {default as commentList} from "./commentList";
|
||||
export {default as addVideo} from "./addVideo";
|
||||
export {default as addArticle} from "./addArticle";
|
||||
export {default as newsDetail} from "./newsDetail";
|
||||
export {default as videoDetail} from "./videoDetail";
|
||||
143
project/qujing/app/AppPressCenter/components/newsDetail.vue
Normal file
143
project/qujing/app/AppPressCenter/components/newsDetail.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<ai-detail class="news-detail">
|
||||
<template slot="title">
|
||||
<ai-title title="新闻文章详情" isShowBack isShowBottomBorder @onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card titlePosition="center">
|
||||
<template #title>
|
||||
<h2>{{ detail.title }}</h2>
|
||||
<p class="subTitle">类型:{{ dict.getLabel('newsCenterPolicyType', +detail.policyType) }}</p>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-button type="text" size="small" icon="iconfont iconEdit" @click="handleEdit">修改</el-button>
|
||||
</template>
|
||||
<template #content>
|
||||
<ai-article :value="detail.content"></ai-article>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="封面信息">
|
||||
<template #content>
|
||||
<div class="content">
|
||||
<div class="img">
|
||||
<span>封面:</span>
|
||||
<img v-if="detail.coverFile" :src="detail.coverFile.url" alt="" v-viewer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Viewer from 'v-viewer';
|
||||
import Vue from 'vue';
|
||||
|
||||
Vue.use(Viewer);
|
||||
export default {
|
||||
name: "newsDetail",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 修改
|
||||
* */
|
||||
handleEdit() {
|
||||
this.$emit("goPage", {key: "addArticle", row: this.detail});
|
||||
},
|
||||
/**
|
||||
* 根据id查询详情
|
||||
*/
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
id && this.instance.post(`/app/appnewscenterinfo/queryDetailById`, null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.news-detail {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
:deep( .ai-detail__content ){
|
||||
background: #F3F6F9 !important;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin-bottom: 24px;
|
||||
|
||||
p {
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
line-height: 21px;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 14px;
|
||||
color: #5088FF;
|
||||
line-height: 16px;
|
||||
text-align: right;
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
line-height: 21px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 24px;
|
||||
margin-bottom: 17px;
|
||||
}
|
||||
|
||||
.img {
|
||||
display: flex;
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #999999;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 319px;
|
||||
height: 179px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
278
project/qujing/app/AppPressCenter/components/newsList.vue
Normal file
278
project/qujing/app/AppPressCenter/components/newsList.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<ai-list class="news-list" isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<ai-select
|
||||
v-model="searchObj.type"
|
||||
@change="page.current = 1, getList()"
|
||||
placeholder="选择新闻类别"
|
||||
:selectList="$dict.getDict('newsCenterType')">
|
||||
</ai-select>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.title"
|
||||
size="small"
|
||||
placeholder="搜索标题/发布地区"
|
||||
clearable
|
||||
v-throttle="() => {page.current = 1, getList()}"
|
||||
@clear="page.current = 1, searchObj.title = '', getList()"
|
||||
suffix-icon="iconfont iconSearch"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<el-dropdown @visible-change="v=>isClick=v" @command="addNews"
|
||||
v-if="permissions('app_appnewscenterinfo_edit')">
|
||||
<el-button type="primary" icon="iconfont iconAdd" size="small">发布新闻
|
||||
<i class="el-icon--right" :class="dropIcon"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="video">发布视频</el-dropdown-item>
|
||||
<el-dropdown-item command="article">发布文章</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
stripe
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="title" label="标题" width="280" align="left" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">
|
||||
<span style="color: #2266FF;margin-right:40px;" v-if="row.isTop == 1">[置顶]</span>
|
||||
<span>{{ row.title }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" fixed="right" width="260" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" title="取消置顶" v-if="row.isTop==1" @click="setTop(row)">取消置顶</el-button>
|
||||
<el-button type="text" title="置顶" v-else @click="setTop(row)">置顶</el-button>
|
||||
<el-button type="text" title="取消发布" v-if="+row.status" @click="changeStatus(row)">取消发布</el-button>
|
||||
<el-button type="text" v-else title="发布" @click="changeStatus(row)">发布</el-button>
|
||||
<el-button type="text" title="查看" @click="hangeleDetail(row)"
|
||||
:disabled="!permissions('app_appnewscenterinfo_detail')">查看
|
||||
</el-button>
|
||||
<el-button type="text" title="编辑" @click="handleEdit(row)"
|
||||
:disabled="!permissions('app_appnewscenterinfo_edit')">编辑
|
||||
</el-button>
|
||||
<el-button type="text" title="删除" @click="handleDelete(row)"
|
||||
:disabled="!permissions('app_appnewscenterinfo_del')">删除
|
||||
</el-button>
|
||||
<el-button type="text" title="分享" @click="handleCopyShare(row)">小程序链接</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "dayjs"
|
||||
|
||||
export default {
|
||||
name: "newsList",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
total: 0,
|
||||
isClick: false,
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
searchObj: {
|
||||
title: '',
|
||||
type: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
colConfigs() {
|
||||
return [
|
||||
{slot: 'title', label: '标题', width: 280},
|
||||
{
|
||||
prop: 'type', label: '类别', align: 'center',
|
||||
render: (h, {row}) => {
|
||||
return h('span', null, this.dict.getLabel('newsCenterType', +row.type))
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'policyType', label: '类型', align: 'center',
|
||||
render: (h, {row}) => {
|
||||
return h('span', null, this.dict.getLabel('newsCenterPolicyType', +row.policyType))
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'viewCount', label: '浏览/播放量', align: "center",
|
||||
render: (h, {row}) => {
|
||||
return h('span', null, row.viewCount >= 10000 ? ((row.viewCount / 10000).toFixed(2) + '万') : row.viewCount)
|
||||
}
|
||||
},
|
||||
{prop: 'msgCount', label: '评论数', align: "center"},
|
||||
{prop: 'areaName', label: '发布地区', align: 'center'},
|
||||
{prop: 'createTime', label: '发布时间'},
|
||||
{
|
||||
prop: 'status', label: '发布状态', align: 'center',
|
||||
render: (h, {row}) => {
|
||||
return h('span', {
|
||||
style: {
|
||||
color: row.status ? this.$dict.getColor('newsCenterStatus', row.status) : 'auto'
|
||||
}
|
||||
}, this.$dict.getLabel('newsCenterStatus', row.status))
|
||||
}
|
||||
},
|
||||
{slot: 'options', label: '操作'}
|
||||
]
|
||||
},
|
||||
dropIcon() {
|
||||
return this.isClick ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 查看详情
|
||||
* */
|
||||
hangeleDetail(row) {
|
||||
if (+row.type) {
|
||||
this.$emit("goPage", {key: "videoDetail", row});
|
||||
} else {
|
||||
this.$emit("goPage", {key: "newsDetail", row});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* */
|
||||
handleEdit(row) {
|
||||
if (+row.type) {
|
||||
this.$emit("goPage", {key: "addVideo", row});
|
||||
} else {
|
||||
this.$emit("goPage", {key: "addArticle", row});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改新闻中心状态-发布、取消发布
|
||||
* */
|
||||
changeStatus(row) {
|
||||
const msg = +row.status ? "是否取消发布?" : "是否发布?";
|
||||
this.$confirm(msg).then(() => this.changeInfo(row));
|
||||
},
|
||||
/**
|
||||
* 置顶新闻
|
||||
* */
|
||||
setTop(row) {
|
||||
const msg = !row.topping ? "是否要置顶?" : "是否要取消置顶?"
|
||||
this.$confirm(msg).then(() => this.setTopInfo(row));
|
||||
},
|
||||
/**
|
||||
* 删除新闻
|
||||
* */
|
||||
handleDelete({id}) {
|
||||
this.$confirm("是否要删除?").then(() => this.deleteInfo(id));
|
||||
},
|
||||
resetSearch() {
|
||||
this.searchObj.title = "";
|
||||
this.searchObj.type = "";
|
||||
this.getList();
|
||||
},
|
||||
/**
|
||||
* 添加新闻、视频
|
||||
* */
|
||||
addNews(command) {
|
||||
switch (command) {
|
||||
case "video":
|
||||
this.$emit('goPage', {key: "addVideo"});
|
||||
break;
|
||||
case "article":
|
||||
this.$emit('goPage', {key: "addArticle"});
|
||||
break;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 修改发布状态
|
||||
* */
|
||||
changeInfo({id, status}) {
|
||||
const msg = +status ? "取消发布成功" : "发布成功";
|
||||
status = +status ? 0 : 1;
|
||||
this.instance.post(`/app/appnewscenterinfo/release?id=${id}&status=${status}`).then(() => {
|
||||
this.$message.success(msg);
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 置顶新闻
|
||||
* */
|
||||
setTopInfo(row) {
|
||||
const msg = !row.topping ? "置顶成功!" : "取消置顶成功!";
|
||||
this.instance.post(`/app/appnewscenterinfo/topping?id=${row.id}&areaId=${this.areaId}`).then(() => {
|
||||
this.$message.success(msg);
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 删除新闻
|
||||
* @param id
|
||||
*/
|
||||
deleteInfo(id) {
|
||||
this.instance.post(`/app/appnewscenterinfo/delete?ids=${id}`).then(() => {
|
||||
this.$message.success("删除成功");
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.instance.post(`/app/appnewscenterinfo/list`, null, {
|
||||
params: {
|
||||
...this.page,
|
||||
...this.searchObj,
|
||||
areaId: this.areaId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res && res.data) {
|
||||
this.tableData = res.data.records.map(e => {
|
||||
return {
|
||||
...e,
|
||||
createTime: +e.status ? moment(e.createTime).format("YYYY-MM-DD HH:mm") : ''
|
||||
}
|
||||
});
|
||||
this.total = res.data.total;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCopyShare(row) {
|
||||
navigator.clipboard.writeText(`/subPages/live/newsDetail?id=${row.id}`)
|
||||
this.$message.success("小程序链接已复制!")
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.dict.load('newsCenterType', 'newsCenterStatus', 'newsCenterPolicyType').then(() => this.getList());
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.news-list {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: #f3f6f9;
|
||||
|
||||
:deep(.has-gutter th:nth-child(1) div ){
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
90
project/qujing/app/AppPressCenter/components/videoDetail.vue
Normal file
90
project/qujing/app/AppPressCenter/components/videoDetail.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<ai-detail class="video-detail">
|
||||
<template slot="title">
|
||||
<ai-title title="视频新闻详情" isShowBack isShowBottomBorder @onBackClick="$emit('goBack')"/>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="视频信息">
|
||||
<template slot="right">
|
||||
<el-button type="text" icon="iconfont iconEdit" @click="handleEdit">修改</el-button>
|
||||
</template>
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
:columnsNumber="1">
|
||||
<ai-info-item label="标题:" :value="detail.title"></ai-info-item>
|
||||
<ai-info-item label="类型:"
|
||||
:value="dict.getLabel('newsCenterPolicyType', + detail.policyType)"></ai-info-item>
|
||||
<ai-info-item label="视频:" isLine>
|
||||
<video :src="detail.videoFile && detail.videoFile.url"
|
||||
style="width: 100%; height:100%; object-fit: fill;" muted controls="controls"></video>
|
||||
</ai-info-item>
|
||||
<ai-info-item label="封面:" isLine v-viewer>
|
||||
<img :src="detail.videoFile && detail.coverFile.url" alt="">
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Viewer from 'v-viewer';
|
||||
|
||||
export default {
|
||||
name: "videoDetail",
|
||||
components: {Viewer},
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleEdit() {
|
||||
this.$emit("goPage", {key: "addVideo", row: this.detail});
|
||||
},
|
||||
/**
|
||||
* 根据id查询详情
|
||||
*/
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
this.instance.post(`/app/appnewscenterinfo/queryDetailById`, null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.video-detail {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
video {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 319px;
|
||||
height: 179px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user