Files
dvcp_v2_wxcp_app/src/project/saas/AppPropagandaStatistics/AppPropagandaStatistics.vue

699 lines
16 KiB
Vue
Raw Normal View History

2022-07-08 11:22:57 +08:00
<template>
<div class="AppPropagandaStatistics">
2022-07-12 18:10:42 +08:00
<div class="calendar_header">
2022-07-13 10:52:43 +08:00
<u-section title="宣发日历" :show-line="false" sub-title="查看更多" @click="readMore"></u-section>
2022-07-14 15:40:57 +08:00
<!-- <div>{{ calendarList[nowDate - 1] }}</div> -->
2022-07-12 18:10:42 +08:00
</div>
<div class="threeDays">
<div class="yesterday">
2022-07-14 15:40:57 +08:00
<div class="itemYesterday">昨天<span>{{ calendarList[nowDate - 1] }}</span></div>
2022-07-12 18:10:42 +08:00
<div>晴风小区志愿者活动</div>
</div>
<div class="today">
<div class="itemToday">今天<span>11:51</span></div>
<div>晴风小区志愿者活动</div>
</div>
<div class="tomorrow">
<div class="itemTomorrow">明天<span>11:51</span></div>
<div @click="showMore(index)">晴风小区志愿者活动</div>
<div class="isShow" @click="showMore()">{{ isShow ? '收起' : '展开' }}</div>
2022-07-14 15:40:57 +08:00
<span></span>
2022-07-12 18:10:42 +08:00
</div>
</div>
2022-07-11 17:29:18 +08:00
2022-07-11 16:01:51 +08:00
<!-- 折线图 -->
<div class="brokenEcharts">
2022-07-13 10:52:43 +08:00
<div class="broken_title">
<div class="broken_left">宣发效果</div>
2022-07-14 15:40:57 +08:00
<div class="broken_right" @click="filterShow = true"><img src="./images/shaixuan.png" alt="">筛选</div>
2022-07-13 10:52:43 +08:00
</div>
<div class="broken_statistics">
<div class="broken_item">
<div>创建宣发任务数</div>
<div>200</div>
</div>
<div class="broken_item">
<div>执行宣发次数</div>
<div>200</div>
</div>
<div class="broken_item">
<div>触达人次</div>
<div>200</div>
</div>
2022-07-12 18:10:42 +08:00
</div>
2022-07-13 14:35:20 +08:00
<div class="title">触达人次</div>
<div id="brokenEcharts1"></div>
<div class="title">宣发次数</div>
<div id="brokenEcharts2"></div>
<div class="title">宣发任务数</div>
<div id="brokenEcharts3"></div>
2022-07-11 16:01:51 +08:00
</div>
<div class="columnarEcharts">
2022-07-13 10:52:43 +08:00
<div class="broken_title">
<div class="broken_left">宣发明细</div>
2022-07-14 15:40:57 +08:00
<div class="broken_right">
<span :class="detailType ==0? 'active': ''" @click="detailType = 0, getColData()">近七天</span>
<span :class="detailType ==1? 'active': ''" @click="detailType = 1, getColData()">近30天</span>
<span :class="detailType ==2? 'active': ''" @click="detailType = 2, getColData()">近1年</span>
</div>
2022-07-13 10:52:43 +08:00
</div>
2022-07-11 16:01:51 +08:00
<div id="columnarEcharts"></div>
</div>
2022-07-13 10:52:43 +08:00
2022-07-14 15:40:57 +08:00
<u-popup v-model="filterShow" mode="bottom" border-radius="14">
2022-07-13 10:52:43 +08:00
<div class="popup">
<div class="tips"></div>
<div class="title">
2022-07-14 15:40:57 +08:00
<div class="cancel" @click.stop="filterShow=false,timeSelect=0">取消</div>
2022-07-13 10:52:43 +08:00
<p>筛选条件</p>
<div class="confirm" @click.stop="selectConfirm">确定</div>
</div>
<scroll-view class="select-content" scroll-y="true">
<div class="type-list">
<div class="type-title">宣发时间</div>
2022-07-14 15:40:57 +08:00
<div class="item" v-for="(item, index) in timeList" :key="index" :class="index == timeSelect ? 'active' : ''" @click.stop="checkTime(index)">{{item}}</div>
2022-07-13 10:52:43 +08:00
</div>
<div class="type-list">
<div class="type-title">宣发部门</div>
2022-07-14 15:40:57 +08:00
<AiPagePicker type="custom" :selected.sync="deptList" nodeKey="id" :ops="{url:`./selectDeptUser`,label:'name'}" valueObj>
<span class="label" v-if="deptList.length">已选择</span>
<span v-else style="color:#999;">请选择</span>
<u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/>
</AiPagePicker>
2022-07-13 10:52:43 +08:00
</div>
</scroll-view>
2022-07-14 15:40:57 +08:00
<div class="popBtn">
<div @click="reset">重置</div>
<div @click="selectConfirm">确认</div>
</div>
2022-07-13 10:52:43 +08:00
</div>
2022-07-14 15:40:57 +08:00
<u-popup v-model="customShow" mode="bottom" border-radius="14" closeable>
<div class="customPop">
<div class="startTime">
<div>开始时间</div>
<div>
<u-input v-model="start" placeholder="请输入格式为2022-00-00的开始时间" type="text" clearable/>
</div>
</div>
<div class="endTime">
<div>结束时间</div>
<div>
<u-input v-model="end" placeholder="请输入格式为2022-00-00的结束时间" type="text" clearable/>
</div>
</div>
<div class="timeBtn" @click="handleTime">确定</div>
</div>
</u-popup>
2022-07-13 10:52:43 +08:00
</u-popup>
2022-07-08 11:22:57 +08:00
</div>
</template>
<script>
2022-07-11 16:01:51 +08:00
import echarts from 'echarts';
2022-07-08 11:22:57 +08:00
export default {
name: 'AppPropagandaStatistics',
appName: '宣发统计',
data() {
return {
2022-07-12 18:10:42 +08:00
isShow: false,
2022-07-13 14:35:20 +08:00
brokenEcharts1: null,
brokenEcharts2: null,
brokenEcharts3: null,
2022-07-11 16:01:51 +08:00
columnarEcharts: null,
2022-07-13 10:52:43 +08:00
filterShow: false,
2022-07-14 15:40:57 +08:00
customShow: false,
timeList: ['近7天', '近30天', '近1年','自定义'],
timeSelect: 0,
start: '',
end: '',
deptList: [],
nowDate: '',
calendarList: [],
colData: {},
detailType: 0,
timeType: '',
departId: '',
startTime: '',
endTime: '',
2022-07-08 11:22:57 +08:00
}
},
2022-07-12 18:10:42 +08:00
2022-07-08 11:22:57 +08:00
onShow() {
document.title = '宣发统计'
2022-07-14 15:40:57 +08:00
this.getData()
this.getNowDate()
2022-07-11 16:01:51 +08:00
},
mounted() {
2022-07-13 14:35:20 +08:00
this.getBrokenEcharts1()
this.getBrokenEcharts2()
this.getBrokenEcharts3()
2022-07-11 16:01:51 +08:00
this.getColumnarEcharts()
2022-07-14 15:40:57 +08:00
this.getColData()
2022-07-08 11:22:57 +08:00
},
methods: {
2022-07-12 18:10:42 +08:00
showMore() {},
2022-07-14 15:40:57 +08:00
checkTime(index) {
if(index == 3) {
this.timeSelect = index
this.customShow = true
} else {
this.timeSelect = index
}
},
2022-07-12 18:10:42 +08:00
2022-07-13 10:52:43 +08:00
readMore() {
uni.navigateTo({url: `./calendarInfo`})
},
2022-07-14 15:40:57 +08:00
// 重置
reset() {
this.timeType = 0
this.startTime = ''
this.endTime = ''
this.departId = ''
},
selectConfirm() {
if(this.timeSelect == 3) {
this.timeType = this.timeSelect
this.startTime = this.start
this.endTime = this.end
this.getBrokenDate()
} else {
this.timeType = this.timeSelect
this.getBrokenDate()
}
this.filterShow = false
},
handleTime() {
this.startTime = this.start
this.endTime = this.end
this.customShow = false
},
getNowDate() {
let date = new Date()
this.nowDate = date.getDate()
// console.log(this.nowDate);
},
// 宣发日历
getData() {
this.$http.post(`/app/appmasssendingtask/statisticsCalendar`, null, {
params: {
}
}).then((res)=> {{
if(res?.data) {
this.calendarList = res.data
}
}})
},
// 宣发效果
getBrokenDate() {
this.$http.post(`/app/appmasssendingtask/statisticsEffect`, null, {
params: {
type: this.timeSelect,
startTime: this.startTime,
endTime: this.endTime,
departId: this.departId
}
}).then(res=>{
if(res?.data) {
console.log(res);
}
})
},
// 触发人数
2022-07-13 14:35:20 +08:00
getBrokenEcharts1() {
this.brokenEcharts1 = echarts.init(document.getElementById('brokenEcharts1'))
this.brokenEcharts1.setOption({
2022-07-11 16:01:51 +08:00
tooltip: {
trigger: 'axis'
},
grid: {
left: '2%',
2022-07-13 10:52:43 +08:00
right: '5%',
bottom: '2%',
2022-07-11 16:01:51 +08:00
containLabel: true
},
2022-07-13 10:52:43 +08:00
dataZoom: [
{
id: 'dataZoomX',
type: 'slider',
xAxisIndex: [0],
filterMode: 'filter'
},
],
2022-07-11 16:01:51 +08:00
xAxis: {
type: 'category',
boundaryGap: false,
2022-07-13 10:52:43 +08:00
axisTick: {
show: false,
},
axisLine: {
show: false,
},
2022-07-12 18:10:42 +08:00
data: ['2月', '3月', '4月', '5月', '6月', '7月']
2022-07-11 16:01:51 +08:00
},
yAxis: {
type: 'value',
2022-07-13 10:52:43 +08:00
axisTick: {
show: false,
},
axisLine: {
show: false,
}
2022-07-11 16:01:51 +08:00
},
series: [
{
type: 'line',
2022-07-13 14:35:20 +08:00
data: [120, 132, 101, 134, 90, 230],
lineStyle: {
color: '#4B87FE',
},
itemStyle: {
color: '#4E8EEE'
}
2022-07-11 16:01:51 +08:00
},
2022-07-13 14:35:20 +08:00
]
})
},
2022-07-14 15:40:57 +08:00
// 宣发次数
2022-07-13 14:35:20 +08:00
getBrokenEcharts2() {
this.brokenEcharts2 = echarts.init(document.getElementById('brokenEcharts2'))
this.brokenEcharts2.setOption({
tooltip: {
trigger: 'axis'
},
grid: {
left: '2%',
right: '5%',
bottom: '2%',
containLabel: true
},
dataZoom: [
{
id: 'dataZoomX',
type: 'slider',
xAxisIndex: [0],
filterMode: 'filter'
},
],
xAxis: {
type: 'category',
boundaryGap: false,
axisTick: {
show: false,
},
axisLine: {
show: false,
},
data: ['2月', '3月', '4月', '5月', '6月', '7月']
},
yAxis: {
type: 'value',
axisTick: {
show: false,
},
axisLine: {
show: false,
}
},
series: [
2022-07-11 16:01:51 +08:00
{
type: 'line',
2022-07-13 14:35:20 +08:00
data: [220, 182, 191, 234, 290, 330],
lineStyle: {
color: '#32C5FF',
},
itemStyle: {
color: '#31C1FA'
}
},
]
})
},
2022-07-14 15:40:57 +08:00
// 宣发任务数
2022-07-13 14:35:20 +08:00
getBrokenEcharts3() {
this.brokenEcharts3 = echarts.init(document.getElementById('brokenEcharts3'))
this.brokenEcharts3.setOption({
tooltip: {
trigger: 'axis'
},
grid: {
left: '2%',
right: '5%',
bottom: '2%',
containLabel: true
},
dataZoom: [
{
id: 'dataZoomX',
type: 'slider',
xAxisIndex: [0],
filterMode: 'filter'
2022-07-11 16:01:51 +08:00
},
2022-07-13 14:35:20 +08:00
],
xAxis: {
type: 'category',
boundaryGap: false,
axisTick: {
show: false,
},
axisLine: {
show: false,
},
data: ['2月', '3月', '4月', '5月', '6月', '7月']
},
yAxis: {
type: 'value',
axisTick: {
show: false,
},
axisLine: {
show: false,
}
},
series: [
2022-07-11 16:01:51 +08:00
{
type: 'line',
2022-07-13 14:35:20 +08:00
data: [1000, 232, 201, 154, 190, 330],
lineStyle: {
color: '#FFAA44',
},
itemStyle: {
color: '#FFAA44'
}
2022-07-11 16:01:51 +08:00
},
]
})
},
2022-07-14 15:40:57 +08:00
// 宣发明细
getColData() {
this.$http.post(`/app/appmasssendingtask/statisticsDepart`, null, {
params: {
type: this.detailType
}
}).then(res=> {
console.log(res);
if(res?.data) {
console.log(res);
this.colData = res.data
}
})
},
2022-07-11 16:01:51 +08:00
getColumnarEcharts() {
this.columnarEcharts = echarts.init(document.getElementById('columnarEcharts'))
this.columnarEcharts.setOption({
xAxis: {
type: 'category',
2022-07-13 10:52:43 +08:00
axisTick: {
show: false,
},
axisLine: {
show: false,
},
2022-07-11 16:01:51 +08:00
data: ['卫健委', '法院', '团委', '扶贫办', '警察局']
},
yAxis: {
2022-07-13 10:52:43 +08:00
type: 'value',
axisTick: {
show: false,
},
axisLine: {
show: false,
},
2022-07-11 16:01:51 +08:00
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
itemStyle:{
normal:{
color:'#5087ec'
}
},
type: 'bar'
}
]
})
2022-07-11 17:29:18 +08:00
},
2022-07-14 15:40:57 +08:00
2022-07-13 16:59:58 +08:00
2022-07-08 17:33:14 +08:00
}
2022-07-08 11:22:57 +08:00
}
</script>
2022-07-08 17:33:14 +08:00
<style lang="scss" scoped>
.AppPropagandaStatistics {
2022-07-12 18:10:42 +08:00
.calendar_header {
padding: 26px 32px;
box-sizing: border-box;
background: #FFF;
::v-deep .u-section__title__text {
font-size: 32px;
}
2022-07-08 17:33:14 +08:00
}
2022-07-12 18:10:42 +08:00
.threeDays {
background: #FFF;
padding: 8px 32px 12px 32px;
box-sizing: border-box;
.yesterday,
.today,
.tomorrow {
background: #F7F8FA;
margin-bottom: 32px;
padding: 30px 0 30px 40px;
box-sizing: border-box;
.isShow {
color: #3AA0FF;
}
.itemYesterday,
.itemToday,
.itemTomorrow {
color: #999999;
span {
margin-left: 20px;
}
}
}
.yesterday {
border-left: 6px solid #FBD444;
}
.today {
border-left: 6px solid #50CB74;
}
.tomorrow {
border-left: 6px solid #3AA0FF;
}
2022-07-08 17:33:14 +08:00
}
2022-07-12 18:10:42 +08:00
2022-07-13 10:52:43 +08:00
.brokenEcharts,
.columnarEcharts {
margin: 24px 0 24px 0;
padding: 0 32px 32px 32px;
box-sizing: border-box;
.broken_title {
display: flex;
justify-content: space-between;
height: 96px;
2022-07-14 15:40:57 +08:00
align-items: center;
2022-07-13 10:52:43 +08:00
.broken_left {
font-size: 32px;
font-weight: 600;
}
.broken_right {
font-size: 24px;
2022-07-14 15:40:57 +08:00
// color: #3399FF;
img {
width: 28px;
height: 28px;
}
span {
margin-right: 12px;
padding: 8px 10px;
display: inline-block;
border: 1px solid #DDD;
border-radius: 8px;
}
.active {
background: #3399FF;
color: #FFF;
}
2022-07-13 10:52:43 +08:00
}
}
.broken_statistics {
display: flex;
padding: 24px 0;
box-sizing: border-box;
.broken_item {
flex: 1;
text-align: center;
div:first-child {
font-size: 24px;
color: #999999;
padding: 10px 0;
}
div:last-child {
font-size: 36px;
color: #000000;
font-weight: 600;
}
}
}
2022-07-13 14:35:20 +08:00
.title {
padding: 30px 0;
box-sizing: border-box;
font-size: 32px;
font-weight: 600;
}
2022-07-11 16:01:51 +08:00
}
.brokenEcharts,
2022-07-13 16:59:58 +08:00
.columnarEcharts {
2022-07-11 16:01:51 +08:00
background: #FFF;
2022-07-13 14:35:20 +08:00
#brokenEcharts1,
#brokenEcharts2,
#brokenEcharts3,
2022-07-13 16:59:58 +08:00
#columnarEcharts {
2022-07-11 16:01:51 +08:00
width: 100%;
height: 400px;
2022-07-13 10:52:43 +08:00
background: #F9F9F9;
border-radius: 8px;
}
}
.popup{
2022-07-14 15:40:57 +08:00
box-sizing: border-box;
// height: 800px;
2022-07-13 10:52:43 +08:00
.tips{
width: 80px;
height: 6px;
background: #DDDDDD;
border-radius: 4px;
2022-07-14 15:40:57 +08:00
padding: 0 32px;
box-sizing: border-box;
2022-07-13 10:52:43 +08:00
margin: 32px auto 8px auto;
2022-07-11 16:01:51 +08:00
}
2022-07-13 10:52:43 +08:00
.title{
height: 48px;
line-height: 48px;
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #222;
2022-07-14 15:40:57 +08:00
padding: 0 32px;
box-sizing: border-box;
2022-07-13 10:52:43 +08:00
padding-bottom: 32px;
.cancel{
display: inline-block;
width: 200px;
color: #aaa;
}
.confirm{
display: inline-block;
width: 200px;
text-align: right;
color: #333;
}
p{
display: inline-block;
width: calc(100% - 400px);
text-align: center;
font-size: 28px;
}
}
.select-content{
height: calc(100% - 100px);
overflow-y: scroll;
}
.type-list{
2022-07-14 15:40:57 +08:00
padding: 0 32px;
box-sizing: border-box;
2022-07-13 10:52:43 +08:00
margin-bottom: 32px;
.type-title{
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.item{
display: inline-block;
width: 210px;
text-align: center;
line-height: 64px;
background: #F3F4F7;
border-radius: 4px;
margin: 0 16px 16px 0;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
}
.active{
background: #1365DD;
color: #fff;
}
2022-07-14 15:40:57 +08:00
}
.popBtn {
display: flex;
height: 98px;
line-height: 98px;
div {
width: 50%;
border: 2px solid #3399FF;
text-align: center;
}
div:first-child {
color: #3399FF;
}
div:last-child {
color: #FFF;
background: #3399FF;
}
2022-07-13 10:52:43 +08:00
}
}
2022-07-14 15:40:57 +08:00
.customPop {
padding: 80px 32px 20px 32px;
box-sizing: border-box;
.startTime,
.endTime {
border-bottom: 1px solid #DDD;
margin-bottom: 20px;
}
.timeBtn {
width: 100%;
background: #3399FF;
height: 80px;
line-height: 80px;
text-align: center;
border-radius: 16px;
color: #FFF;
}
2022-07-11 16:01:51 +08:00
}
2022-07-08 17:33:14 +08:00
}
2022-07-08 11:22:57 +08:00
2022-07-13 16:59:58 +08:00
</style>