统计
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>积分余额</h2>
|
||||
<p class="color2">{{ data.integral }}</p>
|
||||
<p class="color2">{{ data.integral || 0 }}</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>已用积分</h2>
|
||||
<p class="color3">{{ data.usedIntegral }}</p>
|
||||
<p class="color3">{{ data.usedIntegral || 0 }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="title">
|
||||
<h4>事件汇总</h4>
|
||||
<div class="timecSelect">
|
||||
时间:<el-date-picker size="small" v-model="time" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
时间:<el-date-picker size="small" value-format="yyyy-MM-dd" @change="timeChange" v-model="timeList" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bar_Box">
|
||||
@@ -79,8 +79,10 @@ export default {
|
||||
},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
girdList: [],
|
||||
time: '',
|
||||
timeList: [],
|
||||
data: {},
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@@ -88,28 +90,57 @@ export default {
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
},
|
||||
watch: {
|
||||
timeList(newVal, oldVal) {
|
||||
if(!newVal) {
|
||||
// this.getList()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
colConfigs() {
|
||||
return [
|
||||
{ prop: "", label: '时间', align: "left", width: "200px" },
|
||||
{ prop: "", label: '类型', align: "center", width: "180px" },
|
||||
{ prop: "", label: '变动积分', align: "center",width: "200px" },
|
||||
{ prop: "", label: '剩余积分', align: "center",width: "200px" },
|
||||
{ prop: "", label: '事件', align: "center", },
|
||||
{ prop: "doTime", label: '时间', align: "left", width: "200px" },
|
||||
{ prop: "integralType", label: '类型', align: "center", width: "180px" },
|
||||
{ prop: "changeIntegral", label: '变动积分', align: "center",width: "200px" },
|
||||
{ prop: "nowIntegral", label: '剩余积分', align: "center",width: "200px" },
|
||||
{ prop: "eventDesc", label: '事件', align: "center", },
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail()
|
||||
this.getIntegralChange()
|
||||
},
|
||||
methods: {
|
||||
// 详情
|
||||
getDetail() {
|
||||
this.instance.post(`/app/appintegraluser/girdDetail?id=${id}`).then(res=>{
|
||||
this.instance.post(`/app/appintegraluser/girdDetail?id`).then(res=>{
|
||||
if(res?.data) {
|
||||
this.data = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 余额变动明细
|
||||
getIntegralChange() {
|
||||
this.instance.post(`/app/appintegraluser/getChangeDetail`, null, {
|
||||
param: {
|
||||
...this.page,
|
||||
type: this.type //积分类型
|
||||
}
|
||||
}).then(res => {
|
||||
if(res?.data) {
|
||||
this.tableData = res.data.detailList
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
timeChange() {
|
||||
if(this.timeList.length) {
|
||||
this.startTime = this.timeList[0]
|
||||
this.endTime = this.timeList[1]
|
||||
}
|
||||
},
|
||||
|
||||
getColEcherts() {
|
||||
let chartDom = document.getElementById('chartDom');
|
||||
@@ -165,21 +196,28 @@ export default {
|
||||
}, true);
|
||||
window.addEventListener("resize", this.onResize)
|
||||
},
|
||||
|
||||
onResize() {
|
||||
this.myChart.resize()
|
||||
},
|
||||
|
||||
getTableData() {},
|
||||
|
||||
getListInit() {},
|
||||
|
||||
cancel(isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'gridScoreManage',
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getColEcherts()
|
||||
},
|
||||
|
||||
destroyed () {
|
||||
window.removeEventListener('resize', this.onResize)
|
||||
},
|
||||
|
||||
@@ -4,31 +4,26 @@
|
||||
<div class="title">
|
||||
<p>总体统计</p>
|
||||
<div class="title_right">
|
||||
<div><span v-for="(item,index) in timeCheck" :key="index" :class="currrntTime == index? 'active':''" @click="timeChange(index)">{{item}}</span></div>
|
||||
<el-select size="small" style="width: 200px;" v-model="search.girdId" placeholder="所属网格" clearable
|
||||
@change="getListInit()">
|
||||
<el-option
|
||||
v-for="(item,i) in girdList"
|
||||
:key="i"
|
||||
:label="item.girdName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div>
|
||||
<span v-for="(item,index) in timeCheck" :key="index" :class="type == index? 'active':''"
|
||||
@click="timeChange(index)">{{ item }}</span>
|
||||
</div>
|
||||
<el-cascader ref="cascader1" v-model="girdId" :options="girdOptions" placeholder="所属网格" size="small"
|
||||
:props="defaultProps" :show-all-levels="false" @change="gridChange"></el-cascader>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card_list">
|
||||
<div class="card">
|
||||
<h2>剩余积分汇总<i class="el-icon-warning-outline"></i></h2>
|
||||
<p class="color1">20</p>
|
||||
<p class="color1">{{ data.nowIntegral || 0 }}</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>发放积分</h2>
|
||||
<p class="color1">5</p>
|
||||
<p class="color1">{{ data.addIntegral || 0 }}</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>消耗积分</h2>
|
||||
<p class="color1">0</p>
|
||||
<p class="color1">{{ data.reduceIntegral || 0 }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="echertsBox">
|
||||
@@ -50,13 +45,7 @@
|
||||
<template #left>
|
||||
<el-select size="small" style="width: 200px;" v-model="search.girdId" placeholder="所属网格" clearable
|
||||
@change="getListInit()">
|
||||
<el-option
|
||||
v-for="(item,i) in girdList"
|
||||
:key="i"
|
||||
:label="item.girdName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
<el-option v-for="(item,i) in girdList" :key="i" :label="item.girdName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<ai-select
|
||||
v-model="search.level"
|
||||
@@ -145,13 +134,22 @@ export default {
|
||||
girdList: [],
|
||||
time: '',
|
||||
timeCheck: ['昨日','近7天','近30天','自定义'],
|
||||
currrntTime: '0',
|
||||
dialog: false,
|
||||
dialogDate: false,
|
||||
timeList: '',
|
||||
type: '0',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
data: {},
|
||||
girdId: '',
|
||||
girdOptions: [],
|
||||
defaultProps: {
|
||||
label: 'girdName',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
expandTrigger: 'hover',
|
||||
children: 'girdList'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -172,14 +170,16 @@ export default {
|
||||
created() {
|
||||
this.$dict.load('epidemicDangerousAreaLevel')
|
||||
this.getStatistics()
|
||||
this.getGridList()
|
||||
this.getRanking()
|
||||
},
|
||||
methods: {
|
||||
// 统计接口
|
||||
getStatistics() {
|
||||
this.instance.post('/app/appintegraluser/allGirdIntegral',null, {
|
||||
params: {
|
||||
type: 0,
|
||||
girdId: this.user.info.girdId,
|
||||
type: this.type,
|
||||
girdId: this.girdId,
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime,
|
||||
}
|
||||
@@ -189,6 +189,20 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 事件汇总暂定
|
||||
// 人员、网格排行
|
||||
getRanking() {
|
||||
this.instance.post('/app/appintegraluser/userAndGirdIntegralSort',null,{
|
||||
params: {
|
||||
type: this.type,
|
||||
girdId: this.girdId,
|
||||
startTime: this.startTime,
|
||||
endTime: this.endTime
|
||||
}
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
},
|
||||
getColEcherts1() {
|
||||
let chartDom1 = document.getElementById('chart1');
|
||||
chartDom1.style.width = (window.innerWidth - 435) / 2 + "px";
|
||||
@@ -315,20 +329,45 @@ export default {
|
||||
onResize2() {
|
||||
this.myChart2.resize()
|
||||
},
|
||||
getListInit() {},
|
||||
gridChange(val) {
|
||||
console.log(val);
|
||||
},
|
||||
|
||||
getGridList() {
|
||||
this.instance.post(`/app/appgirdinfo/listAll`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.girdOptions = this.formatTree(res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
formatTree(data) {
|
||||
for (var i = 0; i < data.length; i++){
|
||||
if(data[i].girdList.length < 1) {
|
||||
data[i].girdList = undefined
|
||||
} else {
|
||||
this.formatTree(data[i].girdList)
|
||||
}
|
||||
}
|
||||
return data
|
||||
},
|
||||
|
||||
getTableData() {},
|
||||
|
||||
timeChange(index) {
|
||||
if(index == 3) {
|
||||
this.dialogDate = true
|
||||
this.type = index
|
||||
} else {
|
||||
this.currrntTime = index
|
||||
this.type = index
|
||||
}
|
||||
},
|
||||
|
||||
open(id) {
|
||||
this.dialog = true
|
||||
this.getDetail(id)
|
||||
},
|
||||
|
||||
getDetail(id) {
|
||||
|
||||
},
|
||||
@@ -337,30 +376,24 @@ export default {
|
||||
if(!this.timeList || !this.timeList.length) {
|
||||
return this.$message.error('请选择自定义时间');
|
||||
}
|
||||
|
||||
if(this.isEffectTimeSelect) { //宣发效果
|
||||
this.timeListEffect = this.timeList
|
||||
this.effectType = 3
|
||||
// this.getEffect()
|
||||
} else { //宣发明细
|
||||
this.timeListDepart = this.timeList
|
||||
this.departType = 3
|
||||
// this.getDepart()
|
||||
}
|
||||
this.startTime = this.timeList?.[0]
|
||||
this.endTime = this.timeList?.[1]
|
||||
this.dialogDate = false
|
||||
this.getStatistics()
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getColEcherts1()
|
||||
this.getColEcherts2()
|
||||
},
|
||||
|
||||
destroyed () {
|
||||
window.removeEventListener('resize', this.onResize1)
|
||||
window.removeEventListener('resize', this.onResize2)
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user