宣发统计

This commit is contained in:
liuye
2022-07-20 14:25:28 +08:00
parent 0fa2950bb7
commit 8aee36e808

View File

@@ -104,7 +104,9 @@
<div class="time-select" :class="departType == index ? 'active' : ''" v-for="(item, index) in dateTypeList" :key="index" @click="changeDepartType(index)">{{item}}</div>
</div>
</div>
<div id="departBarChart"></div>
<div id="departBarChart">
<ai-empty v-if="!isDepartData"></ai-empty>
</div>
</div>
<ai-dialog :visible.sync="dialogDate" title="选择时间" width="500px" customFooter :show-close="false">
@@ -119,7 +121,7 @@
<script>
import * as echarts from "echarts";
import { mapActions } from 'vuex';
import { mapActions, mapState } from 'vuex';
export default {
name: 'AppAnnounceStatistics',
label: '协同宣发统计',
@@ -150,10 +152,13 @@ import { mapActions } from 'vuex';
timeList: '',
deptList: [],
selectDeptName: '',
isDepartData: true,
type: '',
}
},
computed: {
...mapState(['user']),
},
watch: {
calendarDate: function() {
var year = '' , month = '', date = ''
@@ -201,24 +206,7 @@ import { mapActions } from 'vuex';
this.getCalendarList(year, month)
this.getEffect()
this.getDepart()
this.dict.load("mstSendType")
var items = [{type: 'departmentName', id: '10'}]
this.initOpenData({canvas:true})
setTimeout(() => {
this.transCanvas(items).then((data) => {
console.log(data)
})
}, 2000)
// WWOpenData.prefetch({ items }, (err, data) => {
// if (err) {
// console.log(err)
// }
// console.log(data)
// })
this.dict.load("mstSendType")
},
methods: {
...mapActions(['initOpenData', 'transCanvas']),
@@ -325,17 +313,29 @@ import { mapActions } from 'vuex';
var startTime = this.timeList[0] || '' , endTime = this.timeList[1] || ''
this.instance.post(`/app/appmasssendingtask/statisticsDepart?type=${this.departType}&startTime=${startTime}&endTime=${endTime}`).then(res => {
if (res.code == 0) {
// this.dateList = res.data
// this.getTaskList(this.chooseDay)
if(res.data && res.data.length) {
this.isDepartData = true
var items = [], xData = [], yData = []
res.data.map((item) => {
var i = {type: 'departmentName', id: item.deptId, corpid: this.user.info.corpId}
items.push(i)
yData.push(item.taskCount)
})
this.setBarChart()
this.initOpenData({canvas:true})
this.transCanvas(items).then((data) => {
data.items.map((i) => {
xData.push(i.data)
})
this.setBarChart(xData, yData)
})
}else {
this.isDepartData = false
}
}
})
},
setBarChart() {
setBarChart(xData, yData) {
this.departBarChart = echarts.init(document.querySelector(`#departBarChart`))
var option = {
color: ['#2891FF'],
@@ -371,7 +371,7 @@ import { mapActions } from 'vuex';
}
],
xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: xData,
silent: false,
splitLine: {
show: false
@@ -388,7 +388,7 @@ import { mapActions } from 'vuex';
series: [
{
type: 'bar',
data:[120, 200, 150, 80, 70, 110, 130],
data: yData,
barWidth: 20,
barGap: '250%',
large: true