Commit 0ea16ebb authored by 刘怀志's avatar 刘怀志

banner暂存

parent fa426a9f
......@@ -14,7 +14,7 @@ import Qs from 'qs'
// 1. 查询banner管理列表
export function listCmsBanner(query) {
return request({
url: '/cmsbanner/queryCmsBannerByPagination',
url: '/cmsbanner/queryCmsBannerByPaginationForWx',
method: 'get',
params: query
})
......@@ -40,10 +40,9 @@ export function addCmsBanner(data) {
// 4. 修改banner管理
export function updateCmsBanner(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/cmsbanner/update/' + businessId,
url: '/cmsbanner/updateCmsBannerById',
method: 'put',
data
})
......@@ -66,3 +65,12 @@ export function exportCmsBanner(query) {
responseType: 'blob'
})
}
export function assignBannerToBusiness(data) {
data = Qs.stringify(data)
return request({
url: '/cmsbanner/assignBannerToBusiness',
method: 'post',
data: data
})
}
......@@ -81,14 +81,7 @@
</div>
</template>
</el-table-column>
<el-table-column label="分类" prop="type" :show-overflow-tooltip="true" width="130px">
<template slot-scope="scope">
<span v-if="scope.row.type=='0'">课程资源</span>
<span v-else-if="scope.row.type=='1'">其他资源</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="名称" prop="bannerName" :show-overflow-tooltip="true" width="130px">
<el-table-column label="名称" prop="bannerName" :show-overflow-tooltip="true" width="130px">
<template slot-scope="scope">
{{ scope.row.bannerName || '-' }}
</template>
......@@ -165,18 +158,11 @@
<!-- 添加或修改banner管理配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="分类:" prop="type" >
<!-- <el-input v-model.trim="form.type" show-word-limit :maxlength="32" placeholder="请输入类型" />-->
<el-select v-model.trim="form.type" show-word-limit placeholder="请输入类型" style="width: 100%">
<el-option label="课程资源" value="0" />
<el-option label="其他资源" value="1" />
</el-select>
</el-form-item>
<el-form-item label="名称:" prop="bannerName">
<el-input v-model.trim="form.bannerName" show-word-limit :maxlength="500" placeholder="请输入banner名字" />
</el-form-item>
<el-form-item label="图片:" prop="bannerPicture">
<el-input v-model="form.bannerPicture" style="display: none"></el-input>
<el-input v-model="form.bannerPicture" style="display: none" />
<el-upload
class="avatar-uploader"
action="#"
......@@ -245,16 +231,16 @@
import commonField from '@/utils/commonField'
import {
addCmsBanner,
addCmsBanner, assignBannerToBusiness,
delCmsBanner, exportCmsBanner,
getCmsBanner,
listCmsBanner,
updateCmsBanner
} from '@/api/contentManagement/cmsBanner'
import { uploadPublic } from '@/api/contentManagement/sysContest'
import {mapGetters} from "vuex";
import {listAllShop} from "@/api/sysUnit";
import {shareShop} from "@/api/contentManagement/sysContentNewsInformation";
import { mapGetters } from 'vuex'
import { listAllShop } from '@/api/sysUnit'
import { shareShop } from '@/api/contentManagement/sysContentNewsInformation'
export default {
name: 'CmsBanner',
data() {
......@@ -346,18 +332,17 @@ export default {
if (pass) {
this.shareShopLoading = true
const temp = {
newsVideoId: this.ruleForm.row,
unitId: this.ruleForm.shops.join(','),
type: '0'
businessId: this.ruleForm.row,
unitIds: this.ruleForm.shops.join(',')
}
shareShop(temp).then(response => {
assignBannerToBusiness(temp).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.shareShopDiaLog = false
this.loadData()
this.getList()
}
this.shareShopLoading = false
}).catch(e => { this.shareShopLoading = false })
......@@ -374,8 +359,8 @@ export default {
})
},
handleShareShop(row) {
if (row.unitId) {
this.ruleForm.shops = JSON.parse(row.unitId)
if (row.unitIds) {
this.ruleForm.shops = row.unitIds.split(',').map(item => parseInt(item.trim(), 10))
} else {
this.ruleForm.shops = []
}
......@@ -421,7 +406,7 @@ export default {
formData.append('file', file.file)
formData.append('temp', 'CmsBanner')
uploadPublic(formData).then(res => {
console.log('url',res.data.url)
console.log('url', res.data.url)
this.imageUrl = res.data.url
this.showImg = true
this.form.bannerPicture = res.data.businessId
......@@ -449,8 +434,8 @@ export default {
this.loading = true
listCmsBanner(this.queryParams).then(
response => {
this.cmsBannerList = response.rows
this.total = response.total
this.cmsBannerList = response.data.records
this.total = response.data.total
this.loading = false
}
)
......@@ -505,13 +490,9 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getCmsBanner(id).then(response => {
this.form = response.data
this.imageUrl = response.data.url
this.open = true
this.title = '修改banner'
})
this.form = { ...row }
this.open = true
this.title = '修改banner'
},
// 改变状态
handleStatusChange(row) {
......@@ -536,7 +517,11 @@ export default {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
updateCmsBanner(this.form).then(response => {
const temp = {
bannerId: this.form.businessId,
...this.form
}
updateCmsBanner(temp).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
......
......@@ -64,7 +64,7 @@
</el-form>
</div>
<div style="padding:5px 10px">
<div class="tableTitle">点击量管理</div>
<div class="tableTitle">推广次数管理</div>
<el-table v-loading="fullscreenLoading" :data="tableData" border sortable="true">
<span slot="empty">{{ tableDataTips }}</span>
<el-table-column align="left" prop="id" label="序号" width="50px">
......@@ -89,7 +89,7 @@
{{ scope.row.phone || '-' }}
</template>
</el-table-column>
<el-table-column label="点击量" prop="clickThroughRate" :show-overflow-tooltip="true">
<el-table-column label="推广次数" prop="clickThroughRate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.edit === '0'"> {{ scope.row.clickThroughRate || '-' }}</span>
<el-input-number
......@@ -98,7 +98,7 @@
controls-position="right"
:step="1"
step-strictly
placeholder="点击量"
placeholder="推广次数"
clearable
:maxlength="30"
size="small"
......
......@@ -136,7 +136,7 @@
<span>{{ scope.row.releaseDate }}</span>
</template>
</el-table-column>
<el-table-column align="left" prop="readNum" label="点击量" show-overflow-tooltip>
<el-table-column align="left" prop="readNum" label="推广次数" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.readNum }}</span>
</template>
......
......@@ -117,7 +117,7 @@
<span>{{ scope.row.releaseTime }}</span>
</template>
</el-table-column>
<el-table-column align="left" prop="readNum" label="点击量" show-overflow-tooltip>
<el-table-column align="left" prop="readNum" label="推广次数" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.readNum }}</span>
</template>
......
......@@ -16,6 +16,7 @@ import 'echarts/lib/component/visualMap'
import 'echarts/lib/component/dataset'
import 'echarts/map/js/world'
import 'zrender/lib/svg/svg'
import { listAllShop } from '@/api/sysUnit'
export default {
name: 'dashboard',
......@@ -31,6 +32,9 @@ export default {
data.push([r, i])
}
return {
companyName: '',
deptList: [],
queryShop: true,
dashboard: {
orderCount: 0,
userCount: 0
......@@ -45,7 +49,7 @@ export default {
trigger: 'axis'
},
legend: {
data: ['代言人绑定人数', '抖音绑定人数', '抖音视频数量', '员工人数', '文章点击量']
data: ['代言人绑定人数', '抖音绑定人数', '抖音视频数量', '员工人数', '文章推广次数']
},
grid: {
left: '3%',
......@@ -61,7 +65,7 @@ export default {
xAxis: {
type: 'category',
boundaryGap: false,
data: [ '周一', '周二', '周三', '周四', '周五', '周六', '周日']
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
......@@ -92,7 +96,7 @@ export default {
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '文章点击量',
name: '文章推广次数',
type: 'line',
stack: '总量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
......@@ -113,7 +117,7 @@ export default {
{ name: '绑定人数', max: 16000 },
{ name: '视频数量', max: 30000 },
{ name: '员工人数', max: 38000 },
{ name: '点击量', max: 52000 },
{ name: '推广次数', max: 52000 },
{ name: '文章数量', max: 25000 }
]
},
......@@ -191,7 +195,7 @@ export default {
name: 'xxxx有限公司运营报表'
}
],
company: 'xxxx有限公司运营报表',
company: '',
tableData: [{
date: '2016-05-02',
name: '王小虎',
......@@ -213,12 +217,14 @@ export default {
},
computed: {
...mapGetters([
'name'
'name',
'roles',
'deptId'
])
},
created() {
this.fetchData()
this.getDeptList()
},
mounted() {
// 绑定echart图表跟随窗口大小自动缩放
......@@ -231,7 +237,29 @@ export default {
})
},
methods: {
getDeptList() {
listAllShop().then(res => {
if (res.code === 200) {
this.deptList = res.data
this.company = this.deptList[0].businessId
this.companyName = this.deptList[0].unitName
this.roleFunction()
}
})
},
fetchData() {
},
roleFunction() {
if (this.roles[0].roleKey !== 'admin') {
console.log('this.roles', this.roles)
this.queryShop = false
this.company = this.deptId
this.deptList.forEach(item => {
if (item.businessId === this.deptId) {
this.companyName = item.unitName
}
})
}
}
}
}
<template>
<div class="dashboard-container" id="dashboard">
<div class="dashboard-text">
xxxx有限公司运营报表
<el-select v-model="company" placeholder="选择公司">
{{companyName}}运营报表
<el-select v-model="company" :disabled="!queryShop" filterable placeholder="请选择所属商家">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
v-for="(item,index) in deptList"
:key="index"
:label="item.unitName"
:value="item.businessId"
/>
</el-select>
</div>
......@@ -61,7 +61,7 @@
</div>
</el-col>
<el-col :span="12" >
<div class="card-panel-text">点击量</div>
<div class="card-panel-text">推广次数</div>
<div class="card-panel-num">
{{dashboard.orderCount}}
</div>
......@@ -116,7 +116,6 @@
</div>
</template>
<script src="./dashboard.js"></script>
<style rel="stylesheet/scss" lang="scss" scoped>
.el-row{
......
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