Commit 795785ef authored by 杨硕's avatar 杨硕

对接首页统计图接口

parent 23799b48
...@@ -19,7 +19,15 @@ export function barChar(query) { ...@@ -19,7 +19,15 @@ export function barChar(query) {
// 文章视频推广次数 // 文章视频推广次数
export function pieChart(query) { export function pieChart(query) {
return request({ return request({
url: '/sysunit/statisticsByTypePieChart', url: '/sysunit/statisticsByType',
method: 'get',
params: query
})
}
export function aListOfPromotionAmounts(query) {
return request({
url: '/sysunit/aListOfPromotionAmounts',
method: 'get', method: 'get',
params: query params: query
}) })
......
...@@ -133,6 +133,20 @@ export function importSysUserExcel(data) { ...@@ -133,6 +133,20 @@ export function importSysUserExcel(data) {
}) })
} }
export function importSpokesmanExcel(data) {
return request({
url: '/cmspriceclick/import',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
transformRequest: [(data) => {
return data
}],
data
})
}
// 7.导出用户 // 7.导出用户
export function exportUser(query) { export function exportUser(query) {
return request({ return request({
......
...@@ -140,7 +140,16 @@ ...@@ -140,7 +140,16 @@
<!-- 备注--> <!-- 备注-->
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true"> <el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span> {{ scope.row.remarks || '-' }}</span> <span v-if="scope.row.edit === '0'"> {{ scope.row.remarks || '-' }}</span>
<el-input
v-if="scope.row.edit === '1'"
v-model.trim="scope.row.remarks"
placeholder="备注"
controls-position="right"
step-strictly
clearable
size="small"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250"> <el-table-column label="操作" width="250">
...@@ -792,7 +801,7 @@ import { ...@@ -792,7 +801,7 @@ import {
} from '@/api/try/teaTrialCourse' } from '@/api/try/teaTrialCourse'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
import { validOpenCourse } from '@/api/classManagement' import { validOpenCourse } from '@/api/classManagement'
import { importSysUserExcel, importTemplateSysuser, listByIdentity } from '@/api/system/user' import {importSpokesmanExcel, importSysUserExcel, importTemplateSysuser, listByIdentity} from '@/api/system/user'
import { listAllShop, listCourseAll } from '@/api/sysUnit' import { listAllShop, listCourseAll } from '@/api/sysUnit'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { import {
...@@ -1030,6 +1039,7 @@ export default { ...@@ -1030,6 +1039,7 @@ export default {
handleImport() { handleImport() {
this.upload.title = '推广次数导入' this.upload.title = '推广次数导入'
this.upload.open = true this.upload.open = true
this.filelist = []
}, },
// 获取所有部门信息 // 获取所有部门信息
getDeptList() { getDeptList() {
...@@ -1581,18 +1591,23 @@ export default { ...@@ -1581,18 +1591,23 @@ export default {
// 列表渲染数据 // 列表渲染数据
var data = [] var data = []
const _this = this const _this = this
this.tableData = [] this.tableData = [
_this.fullscreenLoading = true {
cmspriceclickList(this.queryParams).then(res => { remarks: "111111",
_this.total = res.total// 总记录数 edit: '0'
res.records.forEach(item => item['edit'] = '0')
_this.tableData = res.records
this.tableDataOri = JSON.parse(JSON.stringify(res.records))
_this.fullscreenLoading = false
if (res.records.length === 0) {
_this.tableDataTips = '暂无数据'
} }
}) ]
_this.fullscreenLoading = false
// cmspriceclickList(this.queryParams).then(res => {
// _this.total = res.total// 总记录数
// res.records.forEach(item => item['edit'] = '0')
// _this.tableData = res.records
// this.tableDataOri = JSON.parse(JSON.stringify(res.records))
// _this.fullscreenLoading = false
// if (res.records.length === 0) {
// _this.tableDataTips = '暂无数据'
// }
// })
}, },
/** 4.重置时将单位回复正常**/ /** 4.重置时将单位回复正常**/
handleClear() { handleClear() {
...@@ -1616,6 +1631,7 @@ export default { ...@@ -1616,6 +1631,7 @@ export default {
const obj = { const obj = {
businessId: this.tableData[index].businessId, businessId: this.tableData[index].businessId,
price: this.tableData[index].price, price: this.tableData[index].price,
remarks: this.tableData[index].remarks,
clickThroughRate: this.tableData[index].clickThroughRate clickThroughRate: this.tableData[index].clickThroughRate
} }
cmspriceclickUpdate(obj).then(res => { cmspriceclickUpdate(obj).then(res => {
...@@ -1650,9 +1666,10 @@ export default { ...@@ -1650,9 +1666,10 @@ export default {
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
this.upload.open = false this.upload.open = false
this.upload.isUploading = false this.upload.isUploading = false
this.fileList = []
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true }) this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList() this.loadData()
}, },
/** 导入change*/ /** 导入change*/
employeeUpload(file, fileList) { employeeUpload(file, fileList) {
...@@ -1676,10 +1693,7 @@ export default { ...@@ -1676,10 +1693,7 @@ export default {
submitFileForm() { submitFileForm() {
// this.$refs.upload.submit() // this.$refs.upload.submit()
this.importLoading = true this.importLoading = true
if (!this.upload.deptId) { if (this.fileList.length === 0) {
this.$message.warning('请选择所属商家')
this.importLoading = false
} else if (this.fileList.length === 0) {
this.$message.warning('请上传文件') this.$message.warning('请上传文件')
// 导入成功后关闭弹出框 // 导入成功后关闭弹出框
this.importLoading = false this.importLoading = false
...@@ -1688,8 +1702,8 @@ export default { ...@@ -1688,8 +1702,8 @@ export default {
console.log('this.fileList', this.fileList) console.log('this.fileList', this.fileList)
var formData = new FormData() // 当前为空 var formData = new FormData() // 当前为空
formData.append('file', this.fileList) formData.append('file', this.fileList)
formData.append('deptId', this.upload.deptId) // formData.append('deptId', this.upload.deptId)
importSysUserExcel(formData).then(res => { importSpokesmanExcel(formData).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success('导入成功') this.$message.success('导入成功')
this.fileList = [] this.fileList = []
...@@ -1697,7 +1711,7 @@ export default { ...@@ -1697,7 +1711,7 @@ export default {
this.importLoading = false this.importLoading = false
this.upload.open = false this.upload.open = false
// 导入成功后刷新页面 // 导入成功后刷新页面
this.getList() this.loadData()
} else if (res.code === 41020) { } else if (res.code === 41020) {
this.$message.info('上传超时,请重新上传') this.$message.info('上传超时,请重新上传')
this.importLoading = false this.importLoading = false
......
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="16">
<!-- <v-chart ref="barChart" :options="barData" class="chart section" />--> <!-- <v-chart ref="barChart" :options="barData" class="chart section" />-->
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
...@@ -91,6 +91,46 @@ ...@@ -91,6 +91,46 @@
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="8" style="height: 100%">
<!-- <v-chart ref="barChart" :options="barData" class="chart section" />-->
<el-card>
<div slot="header" class="clearfix">
<span>代言人:</span>
</div>
<div class="table-demo-wrapper" style="height: 16vh; width: 100%">
<el-table
:data="list"
style="width: 100%"
class="top"
>
<el-table-column type="index" label="序号" align="center" />
<el-table-column prop="name" label="姓名" align="center" />
<el-table-column prop="phone" label="手机号" align="center" />
<el-table-column prop="clickThroughRate" label="推广次数" align="center" />
<el-table-column prop="price" label="金额" align="center" />
</el-table>
<vue-seamless-scroll
:data="list"
class="seamless-warp"
style="width: 100%"
:class-option="classOption"
>
<el-table
:data="list"
style="width: 100%"
class="bottom"
>
<el-table-column type="index" label="序号" align="center" />
<el-table-column prop="name" label="姓名" align="center" />
<el-table-column prop="phone" label="手机号" align="center" />
<el-table-column prop="clickThroughRate" label="推广次数" align="center" />
<el-table-column prop="price" label="金额" align="center" />
</el-table>
</vue-seamless-scroll>
</div>
</el-card>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
...@@ -104,7 +144,7 @@ ...@@ -104,7 +144,7 @@
</div> </div>
</div> </div>
<div id="echarts-textPieChart" class="span_1"> <div id="echarts-textPieChart" class="span_1">
<div id="dataCharts_textPieChart" style="height: 14vh" /> <div id="dataCharts_textPieChart" style="height: 16vh" />
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
...@@ -139,8 +179,9 @@ ...@@ -139,8 +179,9 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { listAllShop } from '@/api/sysUnit' import { listAllShop } from '@/api/sysUnit'
import { barChar, pieChart, statistics } from '@/api/dashboard' import { aListOfPromotionAmounts, barChar, pieChart, statistics } from '@/api/dashboard'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import vueSeamlessScroll from 'vue-seamless-scroll'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
...@@ -151,6 +192,8 @@ export default { ...@@ -151,6 +192,8 @@ export default {
data.push([r, i]) data.push([r, i])
} }
return { return {
list: [],
allowScroll: true,
isActive: '1', isActive: '1',
activeName: 'first', activeName: 'first',
dataList: {}, dataList: {},
...@@ -181,7 +224,23 @@ export default { ...@@ -181,7 +224,23 @@ export default {
'name', 'name',
'roles', 'roles',
'deptId' 'deptId'
]) ]),
classOption() {
return {
step: 0.4, // 数值越大速度滚动越快
limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
hoverStop: true, // 是否开启鼠标悬停stop
direction: 1, // 0向下 1向上 2向左 3向右
openWatch: true, // 开启数据实时监控刷新dom
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
waitTime: 2000 // 单步运动停止的时间(默认值1000ms)
}
}
},
// 注册组件
components: {
vueSeamlessScroll
}, },
created() { created() {
this.getDeptList() // 商家下拉 this.getDeptList() // 商家下拉
...@@ -231,6 +290,8 @@ export default { ...@@ -231,6 +290,8 @@ export default {
changeCompany() { changeCompany() {
this.getTableData() // 代言人,文章,视频数据 this.getTableData() // 代言人,文章,视频数据
this.handleGetPeoplePromotionFrequency() this.handleGetPeoplePromotionFrequency()
this.handleGetPeopleTextPie()
this.getPromotionArticle()
this.deptList.forEach(item => { this.deptList.forEach(item => {
if (item.businessId === this.company) { if (item.businessId === this.company) {
this.companyName = item.unitName this.companyName = item.unitName
...@@ -249,6 +310,7 @@ export default { ...@@ -249,6 +310,7 @@ export default {
this.handleGetTextVideoEcharts() // 文章视频echarts更新 this.handleGetTextVideoEcharts() // 文章视频echarts更新
this.handleGetPeoplePromotionFrequency() // 代言人文章视频推广次数统计 this.handleGetPeoplePromotionFrequency() // 代言人文章视频推广次数统计
this.handleGetPeopleTextPie() // 代言人文章视频饼图 this.handleGetPeopleTextPie() // 代言人文章视频饼图
this.getPromotionArticle() // 滚动表格数据
} }
}) })
}) })
...@@ -397,7 +459,7 @@ export default { ...@@ -397,7 +459,7 @@ export default {
color: '#91CC75' color: '#91CC75'
}, },
// data: [10, 39, 6, 50, 34, 8, 51, 9, 33, 20, 60] // data: [10, 39, 6, 50, 34, 8, 51, 9, 33, 20, 60]
data: this.barArticle data: this.barVideo
}, },
{ {
name: '视频', name: '视频',
...@@ -407,18 +469,18 @@ export default { ...@@ -407,18 +469,18 @@ export default {
color: '#5470C6' color: '#5470C6'
}, },
// data: [25, 7, 33, 32, 22, 22, 20, 34, 40, 30, 10] // data: [25, 7, 33, 32, 22, 22, 20, 34, 40, 30, 10]
data: this.barVideo data: this.barArticle
}] }]
} }
myChartPeoplePromotionFrequency.setOption(optionAverage) myChartPeoplePromotionFrequency.setOption(optionAverage)
} }
}) })
}, },
/** 代言人文章视频饼图*/ /** 代言人文章饼图*/
handleGetPeopleTextPie() { handleGetPeopleTextPie() {
pieChart({ businessId: this.company }).then(res => { pieChart({ businessId: this.company, type: 0 }).then(res => {
if (res.code === 200) { if (res.code === 200) {
console.log("饼状图",res.data) console.log('饼状图', res.data)
const myChartPeopleTextPie = echarts.init(document.getElementById('dataCharts_textPieChart')) const myChartPeopleTextPie = echarts.init(document.getElementById('dataCharts_textPieChart'))
const optionAverage = { const optionAverage = {
tooltip: { tooltip: {
...@@ -460,6 +522,13 @@ export default { ...@@ -460,6 +522,13 @@ export default {
myChartPeopleTextPie.setOption(optionAverage) myChartPeopleTextPie.setOption(optionAverage)
} }
}) })
},
getPromotionArticle() {
aListOfPromotionAmounts({ businessId: this.company }).then(res => {
if (res.code === 200) {
this.list = res.data
}
})
} }
} }
} }
...@@ -565,4 +634,19 @@ export default { ...@@ -565,4 +634,19 @@ export default {
margin-left: 50px; margin-left: 50px;
margin-top: 8px; margin-top: 8px;
} }
.seamless-warp {
//height: 229px;
overflow: hidden;
}
.min {
display: flex;
width: 100%;
}
>>> .top .el-table__body-wrapper {
display: none !important;
}
>>> .bottom .el-table__header-wrapper {
display: none !important;
width: 100%;
}
</style> </style>
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