网格员积分详情

This commit is contained in:
shijingjing
2022-08-04 11:34:43 +08:00
parent 22b51bf673
commit 59a4be64b5
3 changed files with 454 additions and 69 deletions

View File

@@ -20,12 +20,13 @@
import girdScoreManage from "./components/girdScoreManage"
import gridScoreRules from "./components/gridScoreRules"
import gridScoreStatistics from './components/gridScoreStatistics'
import gridScoreDetail from './components/gridScoreDetail'
import {mapState} from 'vuex'
export default {
name: 'AppGridMemberScore',
label: "网格员积分",
components: {girdScoreManage, gridScoreRules, gridScoreStatistics},
components: {girdScoreManage, gridScoreRules, gridScoreStatistics, gridScoreDetail},
props: {
instance: Function,
dict: Object,
@@ -63,6 +64,12 @@ export default {
comp: gridScoreStatistics,
permission: "",
},
{
label: "网格员积分详情",
name: "gridScoreDetail",
comp: gridScoreDetail,
permission: "",
},
]
}
},
@@ -80,5 +87,6 @@ export default {
<style lang="scss" scoped>
.AppGridMemberScore {
height: 100%;
width: 100%;
}
</style>

View File

@@ -1,26 +1,237 @@
<template>
<section class="gridScoreDetail">
<!-- <ai-detail>
<template #title>
<ai-title title="网格员积分详情" isShowBottomBorder isShowBack @onBackClick="cancel(true)"></ai-title>
<el-row>
<div class="card_list">
<div class="card">
<h2>上报事件</h2>
<p class="color1">20</p>
</div>
<div class="card">
<h2>办结事件</h2>
<p class="color2">5</p>
</div>
<div class="card">
<h2>待办事件</h2>
<p class="color3">0</p>
</div>
</div>
</el-row>
<el-row class="echertsBox" style="margin-bottom: 16px">
<h4>事件汇总</h4>
<div class="bar_Box">
<div id="chartDom" style="height: 300px; width: 100%;"></div>
<ai-empty v-if="false" style="height: 300px;"></ai-empty>
</div>
</el-row>
<ai-card>
<ai-title slot="title" title="余额变动明细" isShowBottomBorder/>
<template #content>
<ai-search-bar>
<template #left>
<el-select size="small" style="width: 200px;margin-left: 16px;" 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>
</template>
<template #right>
<el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.name" clearable
@clear="page.current = 1, search.name = '', getTableData()" suffix-icon="iconfont iconSearch"
v-throttle="() => {(page.current = 1), getTableData();}" style="margin-right: 16px;"/>
<ai-download :instance="instance" url="" :params="search" fileName="网格员积分"
:disabled="tableData.length == 0">
<el-button size="small">导出</el-button>
</ai-download>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<!-- <el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="handleDelete(row.id)">调整积分</el-button>
<el-button type="text" @click="toAdd(row.id)">详情</el-button>
</template>
</el-table-column> -->
</ai-table>
</template>
</ai-detail> -->
</ai-card>
</section>
</template>
<script>
import * as echarts from 'echarts';
export default {
name: "gridScoreDetail",
label: "网格员积分详情",
data() {
return {
myChart: null,
tableData: [],
search: {
current: 1,
name: '',
girdId: '',
},
page: {current: 1, size: 10, total: 0},
girdList: [],
}
},
methods: {},
props: {
instance: Function,
dict: Object,
permissions: Function,
},
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", },
// { slot: "options" },
]
}
},
methods: {
getColEcherts() {
let chartDom = document.getElementById('chartDom');
chartDom.style.width = window.innerWidth - 328 + "px";
this.myChart = echarts.init(chartDom);
this.myChart.setOption({
dataZoom: [
{
type: "slider",
xAxisIndex: [0],
filterMode: "filter",
},
],
grid: {
left: '16px',
right: '28px',
bottom: '14px',
top: '30px',
containLabel: true
},
xAxis: {
type: 'category',
data: ['每日签到', '事件上报', '特殊人员跟进', '群发任务', '邀请居民进群']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70,],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
itemStyle: {
normal: {
color: "#5087ec",
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: {
fontSize: 13,
color: '#666'
}
},
},
},
}
]
}, true);
window.addEventListener("resize", this.onResize)
},
onResize() {
this.myChart.resize()
},
getTableData() {},
getListInit() {},
},
mounted() {
this.getColEcherts()
},
destroyed () {
window.removeEventListener('resize', this.onResize)
},
}
</script>
<style lang="scss" scoped>
.gridScoreDetail {}
.gridScoreDetail {
width: 100%;
height: 100%;
padding: 0 0 20px 0;
box-sizing: border-box;
.card_list {
display: flex;
.card {
flex: 1;
height: 96px;
background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500);
border-radius: 4px;
margin-right: 20px;
padding: 16px 24px;
box-sizing: border-box;
h2 {
color: #888888;
font-weight: 600;
font-size: 16px;
}
p {
margin-top: 8px;
font-size: 24px;
font-weight: 600;
}
.color1 {
color: #2891FF;
}
.color2 {
color: #22AA99;
}
.color3 {
color: #F8B425;
}
}
.card:last-child {
margin-right: 0;
}
}
.echertsBox {
width: 100%;
margin-top: 20px;
background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500);
border-radius: 4px;
padding: 16px;
box-sizing: border-box;
h4 {
color: #222222;
font-style: 16px;
font-weight: 600;
}
.bar_Box {
width: 100%;
#chartDom {
width: 100%;
height: 230px;
margin-top: 16px;
}
}
}
}
</style>

View File

@@ -1,25 +1,91 @@
<template>
<section class="gridScoreStatistics">
<el-row>
<el-row class="overallStatistics">
<div class="title">
<p>总体统计</p>
<div class="title_right">
<div><span v-for="(item,index) in timeCheck" :key="index">{{item}}</span></div>
<el-select size="small" style="width: 200px;margin-left: 16px;" 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>
</div>
<div class="card_list">
<div class="card">
<h2>上报事件</h2>
<h2>剩余积分汇总<i class="el-icon-warning-outline"></i></h2>
<p class="color1">20</p>
</div>
<div class="card">
<h2>办结事件</h2>
<p class="color2">5</p>
<h2>发放积分</h2>
<p class="color1">5</p>
</div>
<div class="card">
<h2>待办事件</h2>
<p class="color3">0</p>
<h2>消耗积分</h2>
<p class="color1">0</p>
</div>
</div>
<div class="echertsBox" style="display: flex;">
<div class="left_Box">
<div id="chart1" style="height: 300px; width: 100%;"></div>
<ai-empty v-if="false" style="height: 300px;"></ai-empty>
</div>
<div class="left_Box">
<div id="chart1" style="height: 300px; width: 100%;"></div>
<ai-empty v-if="false" style="height: 300px;"></ai-empty>
</div>
</div>
</el-row>
<el-row class="echertsBox">
<h4>事件汇总</h4>
<div class="bar_echerts" id="chartDom"></div>
</el-row>
<ai-card>
<ai-title slot="title" title="积分明细" isShowBottomBorder/>
<template #content>
<ai-search-bar>
<template #left>
<el-select size="small" style="width: 200px;margin-left: 16px;" 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>
<ai-select
v-model="search.level"
clearable
placeholder="类型"
:selectList="$dict.getDict('epidemicDangerousAreaLevel')"
@change="search.current = 1, getList()">
</ai-select>
<el-date-picker
v-model="time"
type="datetimerange"
range-separator="-"
size="small"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</template>
<template #right>
<el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.name" clearable
@clear="page.current = 1, search.name = '', getTableData()" suffix-icon="iconfont iconSearch"
v-throttle="() => {(page.current = 1), getTableData();}" style="margin-right: 16px;"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
</ai-table>
</template>
</ai-card>
</section>
</template>
@@ -35,92 +101,192 @@ export default {
},
data() {
return {
name: "积分统计"
name: "积分统计",
myChart: null,
tableData: [],
search: {
current: 1,
name: '',
girdId: '',
},
page: {current: 1, size: 10, total: 0},
girdList: [],
time: '',
timeCheck: ['昨日','近7天','近30天','自定义']
}
},
created() {},
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: "", label: '剩余积分', align: "center", },
{ prop: "", label: '时间', align: "center", },
]
}
},
created() {
this.$dict.load('epidemicDangerousAreaLevel')
},
methods: {
getColEcherts() {
var chartDom = document.getElementById('chartDom');
var myChart = echarts.init(chartDom);
myChart.setOption({
let chartDom = document.getElementById('chart1');
chartDom.style.width = (window.innerWidth - 328) / 2 + "px";
this.myChart = echarts.init(chartDom);
this.myChart.setOption({
dataZoom: [
{
type: "slider",
xAxisIndex: [0],
filterMode: "filter",
},
],
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
data: ['每日签到', '事件上报', '特殊人员跟进', '群发任务', '邀请居民进群']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
data: [120, 200, 150, 80, 70,],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
},
itemStyle: {
normal: {
color: "#5087ec",
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: {
fontSize: 13,
color: '#666'
}
},
},
},
}
]
});
}
}, true);
window.addEventListener("resize", this.onResize)
},
onResize() {
this.myChart.resize()
},
getListInit() {},
getTableData() {},
},
mounted() {
this.getColEcherts()
},
destroyed () {
window.removeEventListener('resize', this.onResize)
},
}
</script>
<style lang="scss" scoped>
.gridScoreStatistics {
height: 100%;
padding: 0 0 20px 0;
box-sizing: border-box;
.card_list {
display: flex;
.card {
flex: 1;
height: 96px;
background: #FFFFFF;
.overallStatistics {
width: 100%;
margin-bottom: 16px;
padding: 20px;
box-sizing: border-box;
background: #FFF;
.title {
width: 100%;
display: flex;
justify-content: space-between;
margin-bottom: 16px;
p {
font-size: 16px;
font-family: MicrosoftYaHeiSemibold;
color: #222222;
font-weight: 600;
}
.title_right {
display: flex;
align-items: center;
span {
display: inline-block;
width: 70px;
height: 32px;
border-radius: 2px;
border: 1px solid #D0D4DC;
margin-right: 8px;
}
}
}
.card_list {
display: flex;
.card {
flex: 1;
height: 96px;
background: #F9F9F9;
border-radius: 2px;
margin-right: 20px;
padding: 16px 24px;
box-sizing: border-box;
h2 {
color: #888888;
font-weight: 600;
font-size: 16px;
}
p {
margin-top: 8px;
font-size: 24px;
font-weight: 600;
}
.color1 {
color: #2891FF;
}
.color2 {
color: #22AA99;
}
.color3 {
color: #F8B425;
}
}
.card:last-child {
margin-right: 0;
}
}
.echertsBox {
width: 100%;
margin-top: 20px;
background: #F9F9F9;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500);
border-radius: 4px;
margin-right: 20px;
padding: 16px 24px;
padding: 16px;
box-sizing: border-box;
h2 {
color: #888888;
font-weight: 600;
font-size: 16px;
}
p {
margin-top: 8px;
font-size: 24px;
h4 {
color: #222222;
font-style: 16px;
font-weight: 600;
}
.color1 {
color: #2891FF;
.bar_Box {
width: 100%;
#chartDom {
width: 100%;
height: 300px;
margin-top: 16px;
}
}
.color2 {
color: #22AA99;
}
.color3 {
color: #F8B425;
}
}
.card:last-child {
margin-right: 0;
}
}
.echertsBox {
margin-top: 20px;
background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15,15,21,0.1500);
border-radius: 4px;
padding: 16px;
box-sizing: border-box;
h4 {
color: #222222;
font-style: 16px;
font-weight: 600;
}
}
}